Commit 2d0df1f9 by Roger Sayle Committed by Roger Sayle

re PR middle-end/27802 (ICE with longjmp)


	PR middle-end/27802
	* reg-stack.c (subst_stack_regs): Handle noreturn function calls
	that (would) return their results in stack registers.

	* gcc.dg/pr27802-1.c: New test case.

From-SVN: r114721
parent e046c56e
2006-06-16 Roger Sayle <roger@eyesopen.com>
PR middle-end/27802
* reg-stack.c (subst_stack_regs): Handle noreturn function calls
that (would) return their results in stack registers.
2006-06-16 Michael Matz <matz@suse.de> 2006-06-16 Michael Matz <matz@suse.de>
Richard Guenther <rguenther@suse.de> Richard Guenther <rguenther@suse.de>
......
...@@ -2282,6 +2282,16 @@ subst_stack_regs (rtx insn, stack regstack) ...@@ -2282,6 +2282,16 @@ subst_stack_regs (rtx insn, stack regstack)
if (NOTE_P (insn) || INSN_DELETED_P (insn)) if (NOTE_P (insn) || INSN_DELETED_P (insn))
return control_flow_insn_deleted; return control_flow_insn_deleted;
/* If this a noreturn call, we can't insert pop insns after it.
Instead, reset the stack state to empty. */
if (CALL_P (insn)
&& find_reg_note (insn, REG_NORETURN, NULL))
{
regstack->top = -1;
CLEAR_HARD_REG_SET (regstack->reg_set);
return control_flow_insn_deleted;
}
/* If there is a REG_UNUSED note on a stack register on this insn, /* If there is a REG_UNUSED note on a stack register on this insn,
the indicated reg must be popped. The REG_UNUSED note is removed, the indicated reg must be popped. The REG_UNUSED note is removed,
since the form of the newly emitted pop insn references the reg, since the form of the newly emitted pop insn references the reg,
......
2006-06-16 Roger Sayle <roger@eyesopen.com>
PR middle-end/27802
* gcc.dg/pr27802-1.c: New test case.
2006-06-15 Mark Mitchell <mark@codesourcery.com> 2006-06-15 Mark Mitchell <mark@codesourcery.com>
PR c++/27689 PR c++/27689
/* Noreturn functions returning FP types used to confuse reg-stack on x86. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
double bar1() __attribute__((noreturn));
void foo1() { bar1(); }
double bar2() __attribute__((noreturn));
double foo2() { return bar2(); }
void bar3() __attribute__((noreturn));
double foo3() { bar3(); }
double bar4() __attribute__((noreturn));
double foo4() { bar4(); }
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