middle-end/112740 - vector boolean CTOR expansion issue
commite1f2d58a1e2536f13d3f2ea2d7373ae62cec9125
authorRichard Biener <rguenther@suse.de>
Wed, 10 Jan 2024 13:54:10 +0000 (10 14:54 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 11 Jan 2024 08:09:46 +0000 (11 09:09 +0100)
tree7ee4abd90951906b38825b0bc5f95e2c913a3bcc
parent1a51886a79c97e53ba945c1926ab215ed6a9f5ed
middle-end/112740 - vector boolean CTOR expansion issue

The optimization to expand uniform boolean vectors by sign-extension
works only for dense masks but it failed to check that.

PR middle-end/112740
* expr.cc (store_constructor): Check the integer vector
mask has a single bit per element before using sign-extension
to expand an uniform vector.

* gcc.dg/pr112740.c: New testcase.
gcc/expr.cc
gcc/testsuite/gcc.dg/pr112740.c [new file with mode: 0644]