Commit f8ed1958 by Richard Henderson Committed by Richard Henderson

re PR target/6087 (3.1 i86 FP stack pop bug)

        PR target/6087
        * reload1.c (fixup_abnormal_edges): Move insn to edge via sequence.

From-SVN: r51543
parent 54e20385
2002-03-28 Richard Henderson <rth@redhat.com>
PR target/6087
* reload1.c (fixup_abnormal_edges): Move insn to edge via sequence.
2002-03-28 Alexandre Oliva <aoliva@redhat.com> 2002-03-28 Alexandre Oliva <aoliva@redhat.com>
* config/i386/freebsd.h (LINK_SPEC): Don't pass default * config/i386/freebsd.h (LINK_SPEC): Don't pass default
......
...@@ -9517,8 +9517,19 @@ fixup_abnormal_edges () ...@@ -9517,8 +9517,19 @@ fixup_abnormal_edges ()
next = NEXT_INSN (insn); next = NEXT_INSN (insn);
if (INSN_P (insn)) if (INSN_P (insn))
{ {
insert_insn_on_edge (PATTERN (insn), e); rtx seq;
delete_insn (insn); delete_insn (insn);
/* We're not deleting it, we're moving it. */
INSN_DELETED_P (insn) = 0;
/* Emit a sequence, rather than scarfing the pattern, so
that we don't lose REG_NOTES etc. */
/* ??? Could copy the test from gen_sequence, but don't
think it's worth the bother. */
seq = gen_rtx_SEQUENCE (VOIDmode, gen_rtvec (1, insn));
insert_insn_on_edge (seq, e);
} }
insn = next; insn = next;
} }
......
// PR target/6087
// The code that moves around insns emitted by reg-stack to cope with
// exception edges lost the REG_DEAD note indicating a pop. Which
// eventually fills up the register stack resulting in Z == NaN.
// { dg-do run }
// { dg-options "-O" }
extern "C" void abort ();
struct Base
{
virtual ~Base() {}
};
struct Foo : public Base
{
Foo ();
};
double x = 3;
double y = 4;
double bar ()
{
double z = x*x+y*y;
if (z != 25.0)
throw 1;
return z;
}
Foo::Foo ()
{
bar ();
}
int main ()
{
try {
int i;
for (i = 0; i < 10; ++i)
new Foo;
} catch (...) {
abort ();
}
return 0;
}
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