https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106187
--- Comment #44 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to rguent...@suse.de from comment #43) > On Mon, 25 Jul 2022, rearnsha at gcc dot gnu.org wrote: > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106187 > > > > --- Comment #42 from Richard Earnshaw <rearnsha at gcc dot gnu.org> --- > > That would be unfortunate, it removes a lot of pointless loads in this case; > > and even the store it removes ought to be safe, if it weren't for the > > corrupted > > alias info that results (the values /are/ the same). > > We only need to scrap the case removing _stores_, removing loads is > all fine. And the fix would, in this case, cause us to preserve > the store anyway (but I expect there are cases where we can detect > the store can be safely removed as well) Btw, there's pass_rtl_dse2 after postreload which may be able to catch most of the important cases as well and it already received the "fix" (and has the info we need readily available).