+2006-08-25 J"orn Rennecke <joern.rennecke@st.com>
+
+ PR tree-optimization/16876
+ * c-typeck.c (c_convert_parm_for_inlining): Don't take early
+ exit if PARM doesn't match VALUE.
+
2006-08-25 Bob Wilson <bob.wilson@acm.org>
* config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Do not emit a
}
/* Convert VALUE for assignment into inlined parameter PARM. ARGNUM
- is used for error and waring reporting and indicates which argument
+ is used for error and warning reporting and indicates which argument
is being processed. */
tree
{
tree ret, type;
- /* If FN was prototyped, the value has been converted already
- in convert_arguments. */
- if (!value || TYPE_ARG_TYPES (TREE_TYPE (fn)))
+ /* If FN was prototyped at the call site, the value has been converted
+ already in convert_arguments.
+ However, we might see a prototype now that was not in place when
+ the function call was seen, so check that the VALUE actually matches
+ PARM before taking an early exit. */
+ if (!value
+ || (TYPE_ARG_TYPES (TREE_TYPE (fn))
+ && (TYPE_MAIN_VARIANT (TREE_TYPE (parm))
+ == TYPE_MAIN_VARIANT (TREE_TYPE (value)))))
return value;
type = TREE_TYPE (parm);
--- /dev/null
+/* { dg-options "-O -finline-functions" } */
+
+static void g();
+struct bigstack {
+ char space[4096];
+};
+
+
+void f() {
+ g(0); /* { dg-error "incompatible type for argument 1 of 'g'" } */
+}
+
+static void g(struct bigstack bstack) {
+ g(bstack);
+}