Avoid losing MEM_REF offset in MEM_EXPR adjustment for stack slot sharing
commit4dfc6bcabb5a040417e60cb8072e562e25974917
authorRichard Biener <rguenther@suse.de>
Wed, 13 Dec 2023 08:05:59 +0000 (13 09:05 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 13 Dec 2023 09:06:30 +0000 (13 10:06 +0100)
treee2f4fe693d9b9e910bd93d918c0b75e0060d26c1
parent93db32a4146afd2a6d90410691351a56768167c9
Avoid losing MEM_REF offset in MEM_EXPR adjustment for stack slot sharing

When investigating PR111591 with respect to TBAA and stack slot sharing
I noticed we're eventually scrapping a [TARGET_]MEM_REF offset when
rewriting the VAR_DECL base of the MEM_EXPR to use a pointer to the
partition instead.  The following makes sure to preserve that.

* emit-rtl.cc (set_mem_attributes_minus_bitpos): Preserve
the offset when rewriting an exising MEM_REF base for
stack slot sharing.
gcc/emit-rtl.cc