public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "matz at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/50317] [4.7 Regression] missing DW_OP_GNU_implicit_pointer
Date: Mon, 28 Nov 2011 15:18:00 -0000	[thread overview]
Message-ID: <bug-50317-4-jfeWP3dEnW@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50317-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50317

--- 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?


  parent reply	other threads:[~2011-11-28 14:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-07 10:57 [Bug debug/50317] New: " jan.kratochvil at redhat dot com
2011-09-07 14:13 ` [Bug debug/50317] " jakub at gcc dot gnu.org
2011-09-07 14:23 ` jakub at gcc dot gnu.org
2011-10-27 10:18 ` rguenth at gcc dot gnu.org
2011-10-27 13:58 ` jan.kratochvil at redhat dot com
2011-11-28 13:25 ` jakub at gcc dot gnu.org
2011-11-28 13:43 ` jakub at gcc dot gnu.org
2011-11-28 14:18 ` matz at gcc dot gnu.org
2011-11-28 14:22 ` jakub at gcc dot gnu.org
2011-11-28 14:48 ` jakub at gcc dot gnu.org
2011-11-28 15:18 ` matz at gcc dot gnu.org [this message]
2011-11-28 15:41 ` jakub at gcc dot gnu.org
2011-11-28 21:06 ` jakub at gcc dot gnu.org
2011-12-01 19:13 ` jakub at gcc dot gnu.org
2011-12-01 19:18 ` jakub at gcc dot gnu.org
2011-12-03 16:40 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-50317-4-jfeWP3dEnW@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).