PR middle-end/34134
* stmt.c (expand_stack_restore): Call expand_normal on var to get
rtx for it instead of assuming it will be a VAR_DECL.
* gcc.c-torture/compile/
20071117-1.c: New test.
From-SVN: r130609
+2007-12-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/34134
+ * stmt.c (expand_stack_restore): Call expand_normal on var to get
+ rtx for it instead of assuming it will be a VAR_DECL.
+
2007-12-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* c-parser (c_parser_statement_after_labels): Move error from here...
void
expand_stack_restore (tree var)
{
- rtx sa = DECL_RTL (var);
+ rtx sa = expand_normal (var);
emit_stack_restore (SAVE_BLOCK, sa, NULL_RTX);
}
+2007-12-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/34134
+ * gcc.c-torture/compile/20071117-1.c: New test.
+
2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34101
--- /dev/null
+/* PR middle-end/34134 */
+
+extern void bar (void *, int);
+
+int foo (int i)
+{
+ char *p = __builtin_stack_save ();
+ void *q = __builtin_alloca (i);
+ bar (q, i);
+ __builtin_stack_restore (p);
+ bar ("", 0);
+ return 6;
+}