fix left-over debug insns in DCE

Alexandre Oliva aoliva@redhat.com
Mon May 30 12:15:00 GMT 2011


The insn shuffling in one of my patches for PR48866 shook out some
latent problems in DCE.

One of the issues was that DCE removed an insn that set a REG in a
certain mode, without adjusting a debug use of that REG.  This was in
libstdc++, but I failed to take note of the affected file.  DF later
attached that debug use to another SET to the same REG in a different,
incompatible mode.  When that one was found to be dead by DF, we ended
up ICEing as we attempted to emit the invalid SUBREGs.

I reused some of the infrastructure to propagate dead DEFs into debug
uses in DF to get DCE to emit debug temps and adjust debug uses as well,
fixing this issue.  While at that, I improved the handling of unused
DEFs in DF, that previously resulted in loss of debug information, so as
to retain it as much as possible.

The changes above ended up exposing another latent problem in regstack,
by which a debug insn referenced a stack register that wasn't available.
I adjusted the code to tolerate this possibility.

This is the patch I ended up with.  Regstrapped on x86_64-linux-gnu and
i686-linux-gnu.  Ok to install?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: vta-df-preserve-unused-dead-in-debug-temp-pr48866.patch
Type: text/x-diff
Size: 21336 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110530/73b1ed5d/attachment.bin>
-------------- next part --------------


-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer


More information about the Gcc-patches mailing list