[Bug tree-optimization/93745] [8/9/10 Regression] Redundant store not eliminated with intermediate instruction

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Feb 17 08:53:00 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93745

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org
   Target Milestone|---                         |8.4

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Object re-use unfortunately also applies to objects with declared types.  Note
the GCC middle-end is _not_ a pure C middle-end and also not a C++42 middle-end
but a middle-end that needs to support a variety of language standards.

As to comment#1 the store simply isn't dead if p points to d and yes, if you
place a load of *p after d then we know that p doesn't point to d via TBAA.

So to optimize the original case we need to know that p doesn't point to d
which for the standalone testcase we can't.

It might be a "regression" but the earlier compiler was simply wrong so I'm
inclined to either SUSPEND this (a FE hint is missing) or close it as INVALID.


More information about the Gcc-bugs mailing list