https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114234
Tamar Christina <tnfchris at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2024-03-05 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #3 from Tamar Christina <tnfchris at gcc dot gnu.org> --- started with commit g:324d2907c86f05e40dc52d226940308f53a956c2 Author: Richard Biener <rguent...@suse.de> Date: Mon Mar 4 09:46:13 2024 +0100 tree-optimization/114192 - scalar reduction kept live with early break vect The following fixes a missing replacement of the reduction value used in the epilog, causing the scalar reduction to be kept live across the early break exit path. PR tree-optimization/114192 * tree-vect-loop.cc (vect_create_epilog_for_reduction): Use the appropriate def for the live out stmt in case of an alternate exit. the reduction seems to propagate out a single value for both exits: # a_39 = PHI <stmp_a_9.10_95(10), stmp_a_9.10_95(15)> but since the PHI nodes carry their reduction values in the exits we have different reduction statements, so using the same reduction value for all exit is wrong. should be # a_39 = PHI <stmp_a_9.10_89(10), stmp_a_9.10_95(15)>