https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110282
Martin Jambor <jamborm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|NEW |RESOLVED
--- Comment #22 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to mcccs from comment #21)
> Okay I'm so sorry for the misinterpretation. I thought DCE should never turn
> an invalid program to a valid one because DCE is always an optimization and
> optimizations should never modify the behavior of the programs. But since
> you're the code owner and someone familiar with GCC internals your word is
> worth 100 times my word so this can be closed.
Your thinking about DCE, meaning the DCE pass, is actually the one
that prevailed. But that is in fact why I was made to write the patch
committed as r12-1848. It also adds a special DCE-like feature to
IPA-SRA pass but it is there specifically for the pass to clean up
after itself, not as a standalone optimization.
Before that the pass did rely on the fact that when a parameter is
used as a divisor or when it is dereferenced, but then the result is
never used, DCE would take care of that operation and remove it. And
so IPA-SRA was happy to keep such operations around even if they used
uninitialized values from what remained of removed formal parameters
of a function. Since it was decided that DCE can be switched off
safely, IPA-SRA had to find all such operations it "created" and
remove it - or rather not copy it the new clone - itself. The line
you removed by sed is an initial part of that process.
*** This bug has been marked as a duplicate of bug 99912 ***