+1999-08-02 Jakub Jelinek <jj@ultra.linux.cz>
+
+ * c-decl.c (get_parm_info, store_parm_decls): Change all uses of
+ PROMOTE_PROTOTYPES, so that it tests it as a C expression.
+ Ensure expr.h is included.
+ * c-typecheck.c (convert_arguments): Ditto.
+
+ * expr.h: Supply default for PROMOTE_PROTOTYPES (0).
+
+ * config/arc/arc.h: Define PROMOTE_PROTOTYPES to 1.
+ * config/convex/convex.h: Ditto.
+ * config/dsp16xx/dsp16xx.h: Ditto.
+ * config/fx80/fx80.h: Ditto.
+ * config/gmicro/gmicro.h: Ditto.
+ * config/i370/i370.h: Ditto.
+ * config/i386/i386.h: Ditto.
+ * config/m32r/m32r.h: Ditto.
+ * config/m68k/m68k.h: Ditto.
+ * config/m88k/m88k.h: Ditto.
+ * config/mips/mips.h: Ditto.
+ * config/pa/pa.h: Ditto.
+ * config/pyr/pyr.h: Ditto.
+ * config/tahoe/tahoe.h: Ditto.
+ * config/we32k/we32k.h: Ditto.
+
+ * config/sparc/sparc.h: Define PROMOTE_PROTOTYPES
+ based on arch size.
+
+ * config/i1750a/i1750a.h: Define PROMOTE_PROTOTYPES to 0.
+
+ * config/i860/paragon.h: Remove PROMOTE_PROTOTYPES
+ from comment.
+
+ * tm.texi: Document new usage of PROMOTE_PROTOTYPES.
+
1999-08-02 Richard Henderson <rth@cygnus.com>
* m32r.c (m32r_setup_incoming_varargs): Use get_varargs_alias_set
#include "c-tree.h"
#include "c-lex.h"
#include "toplev.h"
+#include "expr.h"
#if USE_CPPLIB
#include "cpplib.h"
args are passed in their declared types. */
tree type = TREE_TYPE (decl);
DECL_ARG_TYPE (decl) = type;
-#ifdef PROMOTE_PROTOTYPES
- if ((TREE_CODE (type) == INTEGER_TYPE
- || TREE_CODE (type) == ENUMERAL_TYPE)
+ if (PROMOTE_PROTOTYPES
+ && (TREE_CODE (type) == INTEGER_TYPE
+ || TREE_CODE (type) == ENUMERAL_TYPE)
&& TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))
DECL_ARG_TYPE (decl) = integer_type_node;
-#endif
types = saveable_tree_cons (NULL_TREE, TREE_TYPE (decl), types);
if (TYPE_MAIN_VARIANT (TREE_VALUE (types)) == void_type_node && ! erred
`int foo(float x) {...}'. This is particularly
useful for argument types like uid_t. */
DECL_ARG_TYPE (parm) = TREE_TYPE (parm);
-#ifdef PROMOTE_PROTOTYPES
- if ((TREE_CODE (TREE_TYPE (parm)) == INTEGER_TYPE
- || TREE_CODE (TREE_TYPE (parm)) == ENUMERAL_TYPE)
+
+ if (PROMOTE_PROTOTYPES
+ && (TREE_CODE (TREE_TYPE (parm)) == INTEGER_TYPE
+ || TREE_CODE (TREE_TYPE (parm)) == ENUMERAL_TYPE)
&& TYPE_PRECISION (TREE_TYPE (parm))
< TYPE_PRECISION (integer_type_node))
DECL_ARG_TYPE (parm) = integer_type_node;
-#endif
+
if (pedantic)
{
pedwarn ("promoted argument `%s' doesn't match prototype",
(char *) 0, /* arg passing */
fundecl, name, parmnum + 1);
-#ifdef PROMOTE_PROTOTYPES
- if ((TREE_CODE (type) == INTEGER_TYPE
- || TREE_CODE (type) == ENUMERAL_TYPE)
+ if (PROMOTE_PROTOTYPES
+ && (TREE_CODE (type) == INTEGER_TYPE
+ || TREE_CODE (type) == ENUMERAL_TYPE)
&& (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)))
parmval = default_conversion (parmval);
-#endif
}
result = tree_cons (NULL_TREE, parmval, result);
}
#define PRETEND_OUTGOING_VARARGS_NAMED 0
#endif
+/* Supply a default definition for PROMOTE_PROTOTYPES. */
+#ifndef PROMOTE_PROTOTYPES
+#define PROMOTE_PROTOTYPES 0
+#endif
+
/* Nonzero if we do not know how to pass TYPE solely in registers.
We cannot do so in the following cases:
@table @code
@findex PROMOTE_PROTOTYPES
@item PROMOTE_PROTOTYPES
-Define this macro if an argument declared in a prototype as an
-integral type smaller than @code{int} should actually be passed as an
-@code{int}. In addition to avoiding errors in certain cases of
-mismatch, it also makes for better code on certain machines.
+A C expression whose value is nonzero if an argument declared in
+a prototype as an integral type smaller than @code{int} should
+actually be passed as an @code{int}. In addition to avoiding
+errors in certain cases of mismatch, it also makes for better
+code on certain machines. If the macro is not defined in target
+header files, it defaults to 0.
@findex PUSH_ROUNDING
@item PUSH_ROUNDING (@var{npushed})