aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop-manip.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-06-21 11:10:39 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-06-21 11:10:39 +0000
commitb614fca25fac28542b8c6b2df3862688b96e0581 (patch)
tree9ec3e5ea0e446cb2f85234f12ac00415409b28be /gcc/tree-vect-loop-manip.c
parent1612b1febdd5b6b6ad17c96c980a218bfd40c025 (diff)
downloadgcc-b614fca25fac28542b8c6b2df3862688b96e0581.zip
gcc-b614fca25fac28542b8c6b2df3862688b96e0581.tar.gz
gcc-b614fca25fac28542b8c6b2df3862688b96e0581.tar.bz2
re PR tree-optimization/90913 (ICE in maybe_gen_insn, at optabs.c:7341 since r272239)
2019-06-21 Richard Biener <rguenther@suse.de> PR tree-optimization/90913 * tree-vect-loop-manip.c (vect_loop_versioning): Do not re-use the scalar variant of if-conversion versioning. * gfortran.dg/vect/pr90913.f90: New testcase. From-SVN: r272545
Diffstat (limited to 'gcc/tree-vect-loop-manip.c')
-rw-r--r--gcc/tree-vect-loop-manip.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index 9cf1d48..c5cabc8 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -3095,9 +3095,12 @@ vect_loop_versioning (loop_vec_info loop_vinfo,
}
/* Apply versioning. If there is already a scalar version created by
- if-conversion re-use that. */
+ if-conversion re-use that. Note we cannot re-use the copy of
+ an if-converted outer-loop when vectorizing the inner loop only. */
gcond *cond;
- if (gimple *call = vect_loop_vectorized_call (loop_to_version, &cond))
+ gimple *call;
+ if ((!loop_to_version->inner || loop == loop_to_version)
+ && (call = vect_loop_vectorized_call (loop_to_version, &cond)))
{
gcc_assert (scalar_loop);
condition_bb = gimple_bb (cond);