gcc/ChangeLog:
PR middle-end/33706
* tree-inline.c (copy_bb): Use bsi_replace to replace a
__builtin_va_arg_pack-containing call stmt.
gcc/testsuite/ChangeLog:
PR middle-end/33706
* gcc.dg/va-arg-pack-2.c: New.
From-SVN: r129355
+2007-10-15 Alexandre Oliva <aoliva@redhat.com>
+
+ PR middle-end/33706
+ * tree-inline.c (copy_bb): Use bsi_replace to replace a
+ __builtin_va_arg_pack-containing call stmt.
+
2007-10-15 Razya Ladelsky <razya@il.ibm.com>
* matrix-reorg.c (gate_matrix_reorg): Don't comment out whole
+2007-10-15 Alexandre Oliva <aoliva@redhat.com>
+
+ PR middle-end/33706
+ * gcc.dg/va-arg-pack-2.c: New.
+
2007-10-15 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/33619
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern void noreturn (int status, ...);
+
+extern inline __attribute ((always_inline)) void
+error (int status, ...)
+{
+ if (__builtin_constant_p (status))
+ noreturn (status, __builtin_va_arg_pack ());
+}
+
+void
+f (void)
+{
+ error (1);
+}
if (TREE_CODE (*call_ptr) == WITH_SIZE_EXPR)
call_ptr = &TREE_OPERAND (*call_ptr, 0);
gcc_assert (*call_ptr == call);
- *call_ptr = new_call;
- stmt = *stmtp;
- update_stmt (stmt);
+ if (call_ptr == stmtp)
+ {
+ bsi_replace (©_bsi, new_call, true);
+ stmtp = bsi_stmt_ptr (copy_bsi);
+ stmt = *stmtp;
+ }
+ else
+ {
+ *call_ptr = new_call;
+ stmt = *stmtp;
+ update_stmt (stmt);
+ }
}
else if (call
&& id->call_expr