middle-end/101530 - fix shufflevector lowering
authorRichard Biener <rguenther@suse.de>
Wed, 5 Jan 2022 14:13:33 +0000 (15:13 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 10 Jan 2022 10:29:43 +0000 (11:29 +0100)
commitbe59671c5624fe8bf21ddb0192e97ebdfa4db381
treec7d5dc368bf7380f136fe20d687cb0a541f6f782
parent92e114d66e93d60dcef97c66cddbae38b657d768
middle-end/101530 - fix shufflevector lowering

This makes __builtin_shufflevector lowering force the result
of the BIT_FIELD_REF lowpart operation to a temporary as to
fulfil the IL verifier constraint that BIT_FIELD_REFs should
be always in outermost handled component position.  Trying to
enforce this during gimplification isn't as straight-forward
as here where we know we're dealing with an rvalue.

FAIL: c-c++-common/torture/builtin-shufflevector-1.c   -O0  execution test

2022-01-05  Richard Biener  <rguenther@suse.de>

PR middle-end/101530
gcc/c-family/
* c-common.c (c_build_shufflevector): Wrap the BIT_FIELD_REF
in a TARGET_EXPR to force a temporary.

gcc/testsuite/
* c-c++-common/builtin-shufflevector-3.c: New testcase.
gcc/c-family/c-common.c
gcc/testsuite/c-c++-common/builtin-shufflevector-3.c [new file with mode: 0644]