https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115723
--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to edison from comment #13) > (In reply to GCC Commits from comment #11) > > The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: > > > > https://gcc.gnu.org/g:286cda3461d6f5ce7d911d3f26bd4975ea7ea11d > > > > commit r15-1745-g286cda3461d6f5ce7d911d3f26bd4975ea7ea11d > > Author: Richard Biener <rguent...@suse.de> > > Date: Mon Jul 1 10:06:55 2024 +0200 > > > > tree-optimization/115723 - ICE with .COND_ADD reduction > > > > The following fixes an ICE with a .COND_ADD discovered as reduction > > even though its else value isn't the reduction chain link but a > > constant. This would be wrong-code with --disable-checking I think. > > > > PR tree-optimization/115723 > > * tree-vect-loop.cc (check_reduction_path): For a .COND_ADD > > verify the else value also refers to the reduction chain op. > > > > * gcc.dg/vect/pr115723.c: New testcase. > > Does this fix work with gcc 14.1? I have try to use it to replace the same > file in gcc 14.1 and then build gcc 14.1, got these error: Yes, the git revision cherry-picks to GCC 14.1 (well, the GCC 14 branch head which is what I tested) just fine. I've actually verified it fixes building of 521 with patched GCC 14. You can't simply replace whole files though.