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
This commit is contained in:
Jakub Jelinek 2007-12-04 22:55:32 +01:00 committed by Jakub Jelinek
parent ba7963084e
commit b9f9b2101b
4 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,9 @@
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...

View File

@ -1995,7 +1995,7 @@ expand_stack_save (void)
void
expand_stack_restore (tree var)
{
rtx sa = DECL_RTL (var);
rtx sa = expand_normal (var);
emit_stack_restore (SAVE_BLOCK, sa, NULL_RTX);
}

View File

@ -1,3 +1,8 @@
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

View File

@ -0,0 +1,13 @@
/* 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;
}