diff options
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r-- | gcc/tree-vect-loop.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 838803e..df6ab6f 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -2193,6 +2193,12 @@ vect_is_simple_reduction_1 (loop_vec_info loop_info, gimple phi, || (!check_reduction && flow_loop_nested_p (vect_loop, loop))); name = PHI_RESULT (phi); + /* ??? If there are no uses of the PHI result the inner loop reduction + won't be detected as possibly double-reduction by vectorizable_reduction + because that tries to walk the PHI arg from the preheader edge which + can be constant. See PR60382. */ + if (has_zero_uses (name)) + return NULL; nloop_uses = 0; FOR_EACH_IMM_USE_FAST (use_p, imm_iter, name) { |