Commit 9b28cb6f by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/78445 (ICE in maybe_gen_insn, at optabs.c:7014)

	PR tree-optimization/78445
	* tree-if-conv.c (tree_if_conversion): If any_pred_load_store or
	any_complicated_phi, version loop even if flag_tree_loop_if_convert is
	1.  Formatting fix.

	* gcc.dg/pr78445.c: New test.

From-SVN: r242689
parent ee8195d9
2016-11-22 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/78445
* tree-if-conv.c (tree_if_conversion): If any_pred_load_store or
any_complicated_phi, version loop even if flag_tree_loop_if_convert is
1. Formatting fix.
2016-11-22 Martin Liska <mliska@suse.cz> 2016-11-22 Martin Liska <mliska@suse.cz>
PR ipa/78309 PR ipa/78309
2016-11-22 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/78445
* gcc.dg/pr78445.c: New test.
2016-11-22 Szabolcs Nagy <szabolcs.nagy@arm.com> 2016-11-22 Szabolcs Nagy <szabolcs.nagy@arm.com>
PR libgfortran/78449 PR libgfortran/78449
......
/* PR tree-optimization/78445 */
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-loop-if-convert -ftree-vectorize" } */
/* { dg-additional-options "-mavx2" { target { i?86-*-* x86_64-*-* } } } */
int a;
void
foo (int x, int *y)
{
while (a != 0)
if (x != 0)
{
*y = a;
x = *y;
}
else
x = a;
}
...@@ -2808,15 +2808,20 @@ tree_if_conversion (struct loop *loop) ...@@ -2808,15 +2808,20 @@ tree_if_conversion (struct loop *loop)
goto cleanup; goto cleanup;
/* Since we have no cost model, always version loops unless the user /* Since we have no cost model, always version loops unless the user
specified -ftree-loop-if-convert. Either version this loop, or if specified -ftree-loop-if-convert or unless versioning is required.
the pattern is right for outer-loop vectorization, version the Either version this loop, or if the pattern is right for outer-loop
outer loop. In the latter case we will still if-convert the vectorization, version the outer loop. In the latter case we will
original inner loop. */ still if-convert the original inner loop. */
if (flag_tree_loop_if_convert != 1 if (any_pred_load_store
&& !version_loop_for_if_conversion || any_complicated_phi
(versionable_outer_loop_p (loop_outer (loop)) || flag_tree_loop_if_convert != 1)
? loop_outer (loop) : loop)) {
goto cleanup; struct loop *vloop
= (versionable_outer_loop_p (loop_outer (loop))
? loop_outer (loop) : loop);
if (!version_loop_for_if_conversion (vloop))
goto cleanup;
}
/* Now all statements are if-convertible. Combine all the basic /* Now all statements are if-convertible. Combine all the basic
blocks into one huge basic block doing the if-conversion blocks into one huge basic block doing the if-conversion
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment