]> git.ipfire.org Git - people/ms/gcc.git/commit
tree-optimization/108950 - widen-sum reduction ICE
authorRichard Biener <rguenther@suse.de>
Tue, 28 Feb 2023 14:34:27 +0000 (15:34 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 15 Mar 2023 09:11:23 +0000 (10:11 +0100)
commitf4e4108dd005084fc1c88bba14fda6b200e70daa
tree9930dca71f65e2464448e028c9c13fbe722844dd
parentdbbbaed64f39aae57f5f167174121c1be9d18282
tree-optimization/108950 - widen-sum reduction ICE

When we end up with a widen-sum with an invariant smaller operand
the reduction code uses a wrong vector type for it, causing
IL checking ICEs.  The following fixes that and the inefficiency
of using a widen-sum with a widenend invariant operand as well
by actually performing the check the following comment wants.

PR tree-optimization/108950
* tree-vect-patterns.cc (vect_recog_widen_sum_pattern):
Check oprnd0 is defined in the loop.
* tree-vect-loop.cc (vectorizable_reduction): Record all
operands vector types, compute that of invariants and
properly update their SLP nodes.

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

(cherry picked from commit e3837b6f6c28a1d2cea3a69efbda795ea3fb8816)
gcc/testsuite/gcc.dg/vect/pr108950.c [new file with mode: 0644]
gcc/tree-vect-loop.cc
gcc/tree-vect-patterns.cc