Fix problematic interaction between bitfields, unions, SSO and SRA
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 11 Jan 2023 14:58:47 +0000 (15:58 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Wed, 11 Jan 2023 15:03:25 +0000 (16:03 +0100)
commit3e1cba12a8d71e70235a9a9b8f1a237a561db3e7
treeab50dad9a88b4fbfaf9d650658644084fad4bc95
parentde99049f6fe5341024d4d939ac50d063280f90db
Fix problematic interaction between bitfields, unions, SSO and SRA

The handling of bitfields by the SRA pass is peculiar and this must be taken
into account to support the scalar_storage_order attribute.

gcc/
PR tree-optimization/108199
* tree-sra.cc (sra_modify_expr): Deal with reverse storage order
for bit-field references.

gcc/testsuite/
* gcc.dg/sso-17.c: New test.
gcc/testsuite/gcc.dg/sso-17.c [new file with mode: 0644]
gcc/tree-sra.cc