2017-06-19 Richard Biener <rguenther@suse.de>
PR middle-end/81118
* tree-cfgcleanup.c (cleanup_tree_cfg_noloop): Clear niter
estimates if we changed anything.
* gcc.dg/torture/pr81118.c: New testcase.
From-SVN: r249374
+2017-06-19 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/81118
+ * tree-cfgcleanup.c (cleanup_tree_cfg_noloop): Clear niter
+ estimates if we changed anything.
+
2017-06-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/80887
+2017-06-19 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/81118
+ * gcc.dg/torture/pr81118.c: New testcase.
+
2017-06-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/80887
--- /dev/null
+/* { dg-do compile } */
+/* { dg-additional-options "-w" } */
+
+int a[7], b;
+int c()
+{
+ int d, e;
+ for (; d; d++)
+ if (a[d])
+ if (b)
+ return;
+ else if (d >= e)
+ return 0;
+}
timevar_pop (TV_TREE_CLEANUP_CFG);
if (changed && current_loops)
- loops_state_set (LOOPS_NEED_FIXUP);
+ {
+ /* Removing edges and/or blocks may make recorded bounds refer
+ to stale GIMPLE stmts now, so clear them. */
+ free_numbers_of_iterations_estimates (cfun);
+ loops_state_set (LOOPS_NEED_FIXUP);
+ }
return changed;
}