[RFC] fix eliminate-unused-debug-types for casts (PR21391)

Daniel Jacobowitz drow@false.org
Sat Nov 19 05:59:00 GMT 2005


On Wed, Nov 16, 2005 at 01:14:14PM -0400, Aldy Hernandez wrote:
> Hi folks!
> 
> The problem in this PR is that we don't emit dwarf information for types
> that are only used as casts.
> 
> In the following code, "foo" doesn't get a debugging entry:
> 
> 	struct foo { int i; };
> 
> 	int bar (void) { return ((struct foo *)0x1234)->i; }
> 
> Unfortunately, by the time we get to prune_unused_type*, we no longer
> know how the type was used.  To fix this problem, I mark all DIEs for
> types that are used as casts in the front-end, and then consider these
> types as used, when we are prunning the unused types.

During parsing, yes?  Then we'll mark casts used in parsed but
non-emitted functions as used.  Was this patch superseded by the
discussion on gcc@ about enums?


-- 
Daniel Jacobowitz
CodeSourcery, LLC



More information about the Gcc-patches mailing list