fix latent compare-debug problem in cprop

Steven Bosscher stevenb.gcc@gmail.com
Sat Jun 4 14:05:00 GMT 2011


On Sat, Jun 4, 2011 at 2:50 PM, Alexandre Oliva <aoliva@redhat.com> wrote:
> If cprop regards changes to debug insns as “changed”, it will perform
> cfg optimizations and more, even if no non-debug insns were changed,
> causing divergence between -g and -g0 compilations.
>
> This was observed during bootstrap-debug-lib of the SSA coalesce patch,
> building a-strsea.adb with -fcompare-debug.  Because of different CFGs,
> cse2 chose different equivalent pseudos for an insn.  -fcompare-debug
> detected the difference in REG notes, even though the executable code
> turned out to be the same.  We can't count on this luck, though: other
> optimization passes could apply different transformations to the
> different CFGs, producing different executable code, which must never
> happen.
>
> This patch fixes the problem, disregarding changes to debug insns as
> “changed”.  Regstrapped on x86_64-linux-gnu and i686-linux-gnu.  Ok to
> install?

Looks OK to me, although I can't approve it.

I'm curious, though: What CFG changes or other transformations are
performed without this patch? It could be a sign of a missed
optimization before CPROP. Have you looked at that too?

Ciao!
Steven



More information about the Gcc-patches mailing list