diff --git a/gcc/ext-dce.cc b/gcc/ext-dce.cc index e257e3bc873..626c431f601 100644 --- a/gcc/ext-dce.cc +++ b/gcc/ext-dce.cc @@ -1089,16 +1089,9 @@ ext_dce_rd_transfer_n (int bb_index) ext_dce_process_bb (bb); - /* We may have narrowed the set of live objects at the start - of this block. If so, update the bitmaps and indicate to - the generic dataflow code that something changed. */ - if (!bitmap_equal_p (&livein[bb_index], livenow)) - { - bitmap_copy (&livein[bb_index], livenow); - return true; - } - - return false; + /* We only allow widening the set of objects live at the start + of a block. Otherwise we run the risk of not converging. */ + return bitmap_ior_into (&livein[bb_index], livenow); } /* Dummy function for the df_simple_dataflow API. */ diff --git a/gcc/testsuite/gcc.dg/torture/pr119099.c b/gcc/testsuite/gcc.dg/torture/pr119099.c new file mode 100644 index 00000000000..21898593373 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr119099.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ + +int a, b; + +void func2(short); + +void func1() { + while (1) { + int loc = 8; + while (1) { + func2(loc); + if (a) + loc = 3; + else if (b) + break; + loc |= a; + } + } +}