@@ -988,7 +988,7 @@ ext_dce_init (void)
all_blocks = BITMAP_ALLOC (NULL);
changed_pseudos = BITMAP_ALLOC (NULL);
- for (int i = 0; i < n_basic_blocks_for_fn (cfun); i++)
+ for (int i = 0; i < last_basic_block_for_fn (cfun); i++)
if (i != ENTRY_BLOCK && i != EXIT_BLOCK)
bitmap_set_bit (all_blocks, i);
new file mode 100644
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+/* { dg-additional-options "-fno-forward-propagate -fno-tree-ch" } */
+int a, d, e;
+char b = -1, c, f;
+int main() {
+ int g;
+ for (; d < 1; d++) {
+ g = b;
+ for (; c; c = g)
+ ;
+ }
+ f = g;
+ for (; e < 1; e++)
+ if (g >= a)
+ __builtin_abort();
+ return 0;
+}