tree-optimization/111082 - bogus promoted min
commite10cb804e658dbd1e9d58f528f3985362e4e72e7
authorRichard Biener <rguenther@suse.de>
Mon, 21 Aug 2023 09:07:18 +0000 (21 11:07 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 21 Aug 2023 09:46:48 +0000 (21 11:46 +0200)
tree3a21af0b535cac057e653f5e540063cf0102b690
parent03cb6904d1ab6de1f42d06bcf2988bf7b3e7709a
tree-optimization/111082 - bogus promoted min

vectorize_slp_instance_root_stmt promotes operations with undefined
overflow to unsigned arithmetic but fails to consider operations
that do not overflow like MIN which it turned into MIN with wrong
signedness and in the case of the PR an unsupported operation.
The following rectifies this.

PR tree-optimization/111082
* tree-vect-slp.cc (vectorize_slp_instance_root_stmt): Only
pun operations that can overflow.

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