diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eaaf2d87fe0..2a85326102f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2006-01-23 Andrew Pinski + Daniel Berlin + + PR tree-opt/25315 + PR tree-opt/25857 + * tree-ssa-pre.c (insert_extra_phis): If an incomming edge is abnormal + return from the function. + 2006-01-22 Zack Weinberg * rtl.def (match_code): Add second argument. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index eb289c61b23..461ad4c0803 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-01-23 Andrew Pinski + + PR tree-opt/25857 + * g++.dg/opt/pr25857.C: New test. + 2006-01-23 Steven Bosscher Jan Hubicka Richard Guenther diff --git a/gcc/testsuite/g++.dg/opt/pr25857.C b/gcc/testsuite/g++.dg/opt/pr25857.C new file mode 100644 index 00000000000..4e6858fe195 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr25857.C @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int foo(); +int i; + +struct A +{ + ~A() { if (this != (A*)(&i)) foo(); } +}; + +struct B +{ + A a1, a2, a3, a4; + ~B() { foo(); } +}; + +B b; diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index ada654b17c1..a695e90807b 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -2745,6 +2745,10 @@ insert_extra_phis (basic_block block, basic_block dom) FOR_EACH_EDGE (e, ei, block->preds) { + /* We cannot handle abnormal incomming edges correctly. */ + if (e->flags & EDGE_ABNORMAL) + return; + if (first) { bitmap_set_copy (tempset, AVAIL_OUT (e->src));