tree-optimization/109473 - ICE with reduction epilog adjustment op
authorRichard Biener <rguenther@suse.de>
Wed, 12 Apr 2023 08:22:08 +0000 (10:22 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 12 Apr 2023 09:31:28 +0000 (11:31 +0200)
commitdf7f55cb2ae550adeda339a57b657ebe1ad39367
treea39baaef47641c9471cbb52814cb84ed93e8d139
parent2273fd5a6fdbe8f7da2c0e217c279bcbaaa7df9e
tree-optimization/109473 - ICE with reduction epilog adjustment op

The following makes sure to carry out the reduction epilog adjustment
in the original computation type which for pointers is an unsigned
integer type.  There's a similar issue with signed vs. unsigned ops
and overflow which is fixed by this as well.

PR tree-optimization/109473
* tree-vect-loop.cc (vect_create_epilog_for_reduction):
Convert scalar result to the computation type before performing
the reduction adjustment.

* gcc.dg/vect/pr109473.c: New testcase.
gcc/testsuite/gcc.dg/vect/pr109473.c [new file with mode: 0644]
gcc/tree-vect-loop.cc