2014-01-04 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/59519
+ * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1): Don't
+ ICE if get_current_def (current_new_name) is already non-NULL, as long
+ as it is a phi result of some other phi in *new_exit_bb that has
+ the same argument.
+
* config/i386/sse.md (avx512f_load<mode>_mask): Emit vmovup{s,d}
or vmovdqu* for misaligned_operand.
(<sse>_loadu<ssemodesuffix><avxsizesuffix><mask_name>,
2014-01-04 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/59519
+ * gcc.dg/vect/pr59519-1.c: New test.
+ * gcc.dg/vect/pr59519-2.c: New test.
+
* gcc.target/i386/avx512f-vmovdqu32-1.c: Allow vmovdqu64 instead of
vmovdqu32.
--- /dev/null
+/* PR tree-optimization/59519 */
+/* { dg-do compile } */
+/* { dg-additional-options "-O3" } */
+
+int a, b, c, d;
+
+void
+foo (void)
+{
+ for (; d; d++)
+ for (b = 0; b < 14; b++)
+ {
+ c |= 1;
+ if (a)
+ break;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
--- /dev/null
+/* PR tree-optimization/59519 */
+/* { dg-do compile } */
+/* { dg-additional-options "-O3" } */
+
+struct S { int f0; } d;
+int a[8] = { 0 }, b, c, e;
+
+void
+foo (void)
+{
+ for (; e < 1; e++)
+ for (b = 0; b < 7; b++)
+ {
+ c |= (a[b + 1] != 0);
+ if (d.f0)
+ break;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
if (!current_new_name)
continue;
}
- gcc_assert (get_current_def (current_new_name) == NULL_TREE);
+ tree new_name = get_current_def (current_new_name);
+ /* Because of peeled_chrec optimization it is possible that we have
+ set this earlier. Verify the PHI has the same value. */
+ if (new_name)
+ {
+ gimple phi = SSA_NAME_DEF_STMT (new_name);
+ gcc_assert (gimple_code (phi) == GIMPLE_PHI
+ && gimple_bb (phi) == *new_exit_bb
+ && (PHI_ARG_DEF_FROM_EDGE (phi, single_exit (loop))
+ == loop_arg));
+ continue;
+ }
set_current_def (current_new_name, PHI_RESULT (new_phi));
}