middle-end/118692 - ICE with out-of-bound ref expansionmastertrunk
commit6b56e645a7b481693fe6982f8f09ba2e07768bf8
authorRichard Biener <rguenther@suse.de>
Wed, 29 Jan 2025 14:09:35 +0000 (29 15:09 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 30 Jan 2025 09:03:02 +0000 (30 10:03 +0100)
tree811f58cd52a0e1808aa67cfa9864e56d15162d45
parentd1c7837d2d6e5a2997228681166ed8c814891881
middle-end/118692 - ICE with out-of-bound ref expansion

The following guards the BIT_FIELD_REF expansion fallback for
MEM_REFs of entities expanded to register (or constant) further,
avoiding large out-of-bound offsets by, when the access does not
overlap the base object, expanding the offset as if it were zero.

PR middle-end/118692
* expr.cc (expand_expr_real_1): When expanding a MEM_REF
as BIT_FIELD_REF avoid large offsets for accesses not
overlapping the base object.

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