eliminating debug info for symbols/types in unexpanded inlines

Jim Wilson wilson@codesourcery.com
Thu May 7 02:17:00 GMT 2009


On Wed, 2009-05-06 at 19:06 -0700, Jim Wilson wrote:
> At Cisco, it was noticed that when you use an extern variable inside an
> inline function that is optimized away, you still get debug info for

Sorry, I tried to hit Edit/Undo and accidentally hit File/Send which is
right next to it.  Sigh.  Anyways...

I know Cary Coutant is working on a new duplicate header file
elimination scheme, but as far as I know it isn't available yet.  This
patch is a much simpler solution we can use in the meantime.  This patch
has been in use for about a year inside Cisco without any problems so
far, though Cisco is using an older gcc release, so it isn't a complete
proof that this is safe with gcc mainline.

The patch isn't very elegant.  I'm happy to change things like the
option name or variable name if other people think this is useful.

FYI I noticed on mainline that I get two copies of debug info for the
variable bar.  Something is broken on mainline since the gcc-4.4 branch
was made.  Stepping through dwarfout2.c, I see that we have two
different decls for the variable bar, which is why dwarf2out.c emits two
debug entries for it.  I haven't tried to figure out why we have two
decls for one variable yet.

Jim

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dwarf2-used-expand.patch
Type: text/x-patch
Size: 4771 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090507/7f68120f/attachment.bin>


More information about the Gcc-patches mailing list