Commit b9f9b210 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/34134 (ICE when using __builtin_stack_restore)

	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
parent ba796308
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> 2007-12-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* c-parser (c_parser_statement_after_labels): Move error from here... * c-parser (c_parser_statement_after_labels): Move error from here...
...@@ -1995,7 +1995,7 @@ expand_stack_save (void) ...@@ -1995,7 +1995,7 @@ expand_stack_save (void)
void void
expand_stack_restore (tree var) expand_stack_restore (tree var)
{ {
rtx sa = DECL_RTL (var); rtx sa = expand_normal (var);
emit_stack_restore (SAVE_BLOCK, sa, NULL_RTX); 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> 2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34101 PR c++/34101
/* 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment