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
This commit is contained in:
parent
54e203858d
commit
f8ed195839
3 changed files with 64 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
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>
|
||||
|
||||
* config/i386/freebsd.h (LINK_SPEC): Don't pass default
|
||||
|
|
|
@ -9517,8 +9517,19 @@ fixup_abnormal_edges ()
|
|||
next = NEXT_INSN (insn);
|
||||
if (INSN_P (insn))
|
||||
{
|
||||
insert_insn_on_edge (PATTERN (insn), e);
|
||||
rtx seq;
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
47
gcc/testsuite/g++.dg/opt/reg-stack.C
Normal file
47
gcc/testsuite/g++.dg/opt/reg-stack.C
Normal file
|
@ -0,0 +1,47 @@
|
|||
// 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;
|
||||
}
|
Loading…
Add table
Reference in a new issue