re PR middle-end/28493 (Wrong address of stack object used for destructor call on PPC)

PR middle-end/28493
        * builtins.c (expand_builtin_setjmp_receiver): Clobber
        hard_frame_pointer_rtx after using it to update the frame pointer.

From-SVN: r116900
This commit is contained in:
Jason Merrill 2006-09-12 14:02:36 -04:00 committed by Jason Merrill
parent c1a03f0311
commit f01194138c
3 changed files with 37 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2006-09-12 Jason Merrill <jason@redhat.com>
PR middle-end/28493
* builtins.c (expand_builtin_setjmp_receiver): Clobber
hard_frame_pointer_rtx after using it to update the frame pointer.
2006-09-12 Roger Sayle <roger@eyesopen.com>
* target-def.h (TARGET_ASM_OPEN_PAREN): Guard with an #ifndef.

View File

@ -679,7 +679,12 @@ expand_builtin_setjmp_receiver (rtx receiver_label ATTRIBUTE_UNUSED)
#ifdef HAVE_nonlocal_goto
if (! HAVE_nonlocal_goto)
#endif
emit_move_insn (virtual_stack_vars_rtx, hard_frame_pointer_rtx);
{
emit_move_insn (virtual_stack_vars_rtx, hard_frame_pointer_rtx);
/* This might change the hard frame pointer in ways that aren't
apparent to early optimization passes, so force a clobber. */
emit_insn (gen_rtx_CLOBBER (VOIDmode, hard_frame_pointer_rtx));
}
#if ARG_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
if (fixed_regs[ARG_POINTER_REGNUM])

View File

@ -0,0 +1,25 @@
// PR middle-end/28493
extern "C" void abort ();
struct Command *ptr;
struct Command {
Command() { ptr = this; }
virtual ~Command() { if (ptr != this) abort(); }
};
void tryfunc()
{
Command cmd;
throw 1;
}
int main()
{
try
{
tryfunc();
}
catch (int) { }
}