https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107115
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:0af8d957d5911fc7659b4174cfc2213289bbed23 commit r13-3131-g0af8d957d5911fc7659b4174cfc2213289bbed23 Author: Richard Biener <rguent...@suse.de> Date: Thu Oct 6 11:48:03 2022 +0200 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.