+2016-12-13 Michael Matz <matz@suse.de>
+
+ PR tree-optimization/78725
+ * tree-ssa-loop-split.c (split_at_bb_p): Check for overflow and
+ at correct use point.
+
2016-12-13 Martin Liska <mliska@suse.cz>
* asan.c (asan_expand_mark_ifn): Use renamed
+2016-12-13 Michael Matz <matz@suse.de>
+
+ PR tree-optimization/78725
+ * gcc.dg/pr78725.c: New test.
+ * gcc.dg/pr78725-2.c: New test.
+
2016-12-13 Richard Biener <rguenther@suse.de>
PR middle-end/78742
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O3 -fsplit-loops" } */
+
+int a, b, c;
+
+int main ()
+{
+ int d;
+ for (; c < 1; c++)
+ for (d = 0; d < 3; d++)
+ for (b = 0; b < 1; b++)
+ if (c >= d)
+ a = 1;
+
+ if (a != 1)
+ __builtin_abort ();
+
+ return 0;
+}
tree op0 = gimple_cond_lhs (stmt);
tree op1 = gimple_cond_rhs (stmt);
+ struct loop *useloop = loop_containing_stmt (stmt);
- if (!simple_iv (loop, loop, op0, iv, false))
+ if (!simple_iv (loop, useloop, op0, iv, false))
return NULL_TREE;
- if (!simple_iv (loop, loop, op1, &iv2, false))
+ if (!simple_iv (loop, useloop, op1, &iv2, false))
return NULL_TREE;
/* Make it so that the first argument of the condition is
return NULL_TREE;
if (!integer_zerop (iv2.step))
return NULL_TREE;
+ if (!iv->no_overflow)
+ return NULL_TREE;
if (dump_file && (dump_flags & TDF_DETAILS))
{