[vta] don't expand strings just because of debug info

Alexandre Oliva aoliva@redhat.com
Thu Jan 3 07:25:00 GMT 2008


On ppc64, strings used in initializers of automatic variables take up
constant pool entries.  When constant pool entries go out of sync
between debug and non-debug compilations, we output different code (or
at least different data).

This patch works by deferring the decision on whether to emit a string
constant to the end of the expansion of a function.  It handles
scenarios like this:

  # DEBUG var = &"somestring"[0]
  printf (&"something"[0], otherargs);

If the string was completely optimized away, then we can't emit debug
info for it, but we still emit the CONST_STRING in the debug insn, in
case it is indexed to obtain a constant char or some such.  However,
if the same string is expanded elsewhere, then we'll use the same RTX
in debug insns.

I'm checking this in the vta branch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vta-delay-expand-string.patch
Type: text/x-patch
Size: 3848 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080103/48b09173/attachment.bin>
-------------- next part --------------

-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member         http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


More information about the Gcc-patches mailing list