+2014-03-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/60482
+ * tree-vrp.c (register_edge_assert_for_1): Don't add assert
+ if there are multiple uses, but op doesn't live on E edge.
+ * tree-cfg.c (assert_unreachable_fallthru_edge_p): Also ignore
+ clobber stmts before __builtin_unreachable.
+
2014-03-11 Richard Sandiford <rdsandiford@googlemail.com>
* builtins.c (expand_builtin_setjmp_receiver): Use and clobber
+2014-03-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/60482
+ * gcc.dg/vect/pr60482.c: New test.
+
2014-03-11 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60389
--- /dev/null
+/* PR middle-end/60482 */
+/* { dg-do compile } */
+/* { dg-additional-options "-Ofast" } */
+/* { dg-require-effective-target vect_int } */
+
+double
+foo (double *x, int n)
+{
+ double p = 0.0;
+ int i;
+ x = __builtin_assume_aligned (x, 128);
+ if (n % 128)
+ __builtin_unreachable ();
+ for (i = 0; i < n; i++)
+ p += x[i];
+ return p;
+}
+
+/* { dg-final { scan-tree-dump-not "epilog loop required" "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
if (gsi_end_p (gsi))
return false;
stmt = gsi_stmt (gsi);
- if (is_gimple_debug (stmt))
+ while (is_gimple_debug (stmt) || gimple_clobber_p (stmt))
{
- gsi_next_nondebug (&gsi);
+ gsi_next (&gsi);
if (gsi_end_p (gsi))
return false;
stmt = gsi_stmt (gsi);
return false;
/* We know that OP will have a zero or nonzero value. If OP is used
- more than once go ahead and register an assert for OP.
-
- The FOUND_IN_SUBGRAPH support is not helpful in this situation as
- it will always be set for OP (because OP is used in a COND_EXPR in
- the subgraph). */
- if (!has_single_use (op))
+ more than once go ahead and register an assert for OP. */
+ if (live_on_edge (e, op)
+ && !has_single_use (op))
{
val = build_int_cst (TREE_TYPE (op), 0);
register_new_assert_for (op, op, code, val, NULL, e, bsi);