[Bug debug/50317] [4.7 Regression] missing DW_OP_GNU_implicit_pointer

matz at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 28 15:18:00 GMT 2011


--- Comment #10 from Michael Matz <matz at gcc dot gnu.org> 2011-11-28 14:52:50 UTC ---
(In reply to comment #8)
> Perhaps we could drop the var ={v} {CLOBBER} stmts when renaming the var
> into SSA instead.

I think your current patch is better, no use in slowing down the SSA renamer,
there aren't that many points where a var can suddenly become renamed
when it couldn't before.  I think you should send it to gcc-patches
independent if it fixes this one or not.

> As for gcc47-pr50317-1.patch, the another walk isn't because of the
> CLOBBERs, what it tries to solve is drop the ADDRESSABLE bit before
> CDDCE decides to instead optimize all the stores away as unnecessary
> (the former does the right thing for debug info, the latter does not).

But conceivably we can have other passes than CDDCE which can remove
stores, including the last one, so IMO the latter should better be made to
work.  As in, update_address_taken should purely be an optimization, it should
never be required for correct operation.

> The reason why the gcc/tree-ssa-dce.c change doesn't work is that currently we
> rely on the var in debug stmts to be target_for_debug_bind (which among other
> conditions means is_gimple_reg).  That patch emits debug stmts even for cases
> where the var is not is_gimple_reg because of TREE_ADDRESSABLE.  As nothing
> drops the TREE_ADDRESSABLE bit later on (on this testcase we could do it
> somewhere, but not generally, consider e.g. where the first store into some
> addressable var is necessary, but last store is not).  DCE at this point
> doesn't know if it is removing all references of the addressable var from the
> IL.
> Passes that are upset about the !target_for_debug_bind var in debug stmts/debug
> insns are expansion (it doesn't ICE, but doesn't create the implicit pointer
> because the var whose address is taken is addressable) and var-tracking (for
> which it leads to ICEs because VALUE is propagated through into the notes).

Okay, so there are multiple ways out:
1) accept also TREE_ADDRESSABLES in target_for_debug_bind;
   why is it rejecting the needs_to_live_in_memory objects?
2) drop TREE_ADDRESSABLE for unreferenced variables
   (remove_unused_locals, but that again should only be an optimization,
   not a correctness measure)
3) Accept variables in DEBUG_BIND unconditionally if they are
   target_for_debug_bind or not.  Presumably the one creating the debug
   bind will have known what he was doing.

I think (3) looks most sensible?

More information about the Gcc-bugs mailing list