From: Jeff Law Date: Fri, 6 May 2005 16:43:58 +0000 (-0600) Subject: re PR tree-optimization/21380 (ICE compiling with -O) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b8c1d4a1bce11dd9fad78ef63ec757aebaad3054;p=gcc.git re PR tree-optimization/21380 (ICE compiling with -O) PR tree-optimization/21380 * tree-ssa-threadupdate.c (thread_through_all_blocks): Do not thread through a block with no preds. * gcc.c-torture/compile/pr21380.c: New test. From-SVN: r99324 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cca08f2c228..846b95f286a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-05-06 Jeff Law + + PR tree-optimization/21380 + * tree-ssa-threadupdate.c (thread_through_all_blocks): Do not + thread through a block with no preds. + 2005-05-06 Kazu Hirata * tree-ssa-operands.c (clobbered_v_may_defs, clobbered_vuses, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ae841559b0c..4b3ca396ea5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2005-05-06 Jeff Law + + * gcc.c-torture/compile/pr21380.c: New test. + 2005-05-06 Jakub Jelinek PR c++/20961 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr21380.c b/gcc/testsuite/gcc.c-torture/compile/pr21380.c new file mode 100644 index 00000000000..55ac08e7800 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr21380.c @@ -0,0 +1,42 @@ +void bar (void); + +void +foo (int *diff) +{ + double deltay = 0.0; + int Stangent = 0; + int mindiff; + int Sflipped = 0; + int i; + int Sturn, Snofit; + + Sturn = 1; + if (Sturn) + Stangent = 1; + if (Sturn) + { + Sflipped = 0; + Snofit = 1; + while (Snofit) + { + Snofit = 0; + mindiff = 0; + for (i = 0; i < 4; i++) + mindiff = diff[i]; + while (!Snofit && (mindiff < 0.0)) + { + deltay = (Stangent ? deltay : 0.0); + if (deltay < 0.0) + Snofit = 1; + for (i = 0; i < 4; i++) + { + } + } + if (Snofit) + if (Sflipped) + break; + } + if (Snofit) + bar (); + } +} diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c index 617467a4ef0..a5dc0496092 100644 --- a/gcc/tree-ssa-threadupdate.c +++ b/gcc/tree-ssa-threadupdate.c @@ -811,7 +811,8 @@ thread_through_all_blocks (void) FOR_EACH_BB (bb) { - if (bb_ann (bb)->incoming_edge_threaded) + if (bb_ann (bb)->incoming_edge_threaded + && EDGE_COUNT (bb->preds) > 0) { retval |= thread_block (bb); bb_ann (bb)->incoming_edge_threaded = false;