]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/99253 - fix reduction path check
authorRichard Biener <rguenther@suse.de>
Thu, 25 Feb 2021 08:36:33 +0000 (09:36 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 16 Mar 2021 13:10:38 +0000 (14:10 +0100)
commit65767abfdc07547b5435083a5af6ab085e013a4d
treeee6e36557fa6aa11651efd7af8541b9bce092aa1
parenta555e4432115cecc7413b4c7288fbe4c711c757f
tree-optimization/99253 - fix reduction path check

This fixes an ordering problem with verifying that no intermediate
computations in a reduction path are used outside of the chain.  The
check was disabled for value-preserving conversions at the tail
but whether a stmt was a conversion or not was only computed after
the first use.  The following fixes this by re-ordering things
accordingly.

2021-02-25  Richard Biener  <rguenther@suse.de>

PR tree-optimization/99253
* tree-vect-loop.c (check_reduction_path): First compute
code, then verify out-of-loop uses.

* gcc.dg/vect/pr99253.c: New testcase.

(cherry picked from commit 1193d05465acd39b6e3c7095274d8351a1e2cd44)
gcc/testsuite/gcc.dg/vect/pr99253.c [new file with mode: 0644]
gcc/tree-vect-loop.c