middle-end/107115 - avoid bogus redundant store removal during RTL expansion
authorRichard Biener <rguenther@suse.de>
Thu, 6 Oct 2022 09:48:03 +0000 (11:48 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 6 Oct 2022 12:20:04 +0000 (14:20 +0200)
commit0af8d957d5911fc7659b4174cfc2213289bbed23
treebe8272ebd4ca393c1ff8014695c2ab64e440641a
parent33b93ac3f2fb68a2da0d42fd692fe59533f7a84f
middle-end/107115 - avoid bogus redundant store removal during RTL expansion

The following preserves the (premature) redundant store removal
done in store_expr by appropriately guarding it with
mems_same_for_tbaa_p.  The testcase added needs scheduling disabled
for now since there's a similar bug there still present.

PR middle-end/107115
* expr.cc (store_expr): Check mems_same_for_tbaa_p before
eliding a seemingly redundant store.

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