public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/49602] [4.7 Regression] verify_ssa failed (definition does not dominate use) with "-O2 -g"
Date: Fri, 01 Jul 2011 14:53:00 -0000	[thread overview]
Message-ID: <bug-49602-4-JbyRRLsVVm@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-49602-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-07-01 14:52:30 UTC ---
The problem is that for the debug uses before going into SSA we obviously don't
want the uses to affect code generation and thus we don't call
set_livein_block.
Unfortunately that means get_current_def is sometimes incorrect during rewrite_

--- tree-into-ssa.c.jj 22011-06-23 10:13:58.000000000 +0200
+++ tree-into-ssa.c 2011-07-01 16:23:04.000000000 +0200
@@ -1343,7 +1343,15 @@ rewrite_debug_stmt_uses (gimple stmt)
             }
         }
       else
-        def = get_current_def (var);
+        {
+          def = get_current_def (var);
+          if (def
+              && !SSA_NAME_IS_DEFAULT_DEF (def)
+              && gimple_bb (SSA_NAME_DEF_STMT (def)) != gimple_bb (stmt)
+              && !dominated_by_p (CDI_DOMINATORS, gimple_bb (stmt),
+                                  gimple_bb (SSA_NAME_DEF_STMT (def))))
+            def = NULL;
+        }
       if (def == NULL)
         {
           gimple_debug_bind_reset_value (stmt);

seems to fix the ICE, the question is if get_current_def can be trusted to be
the right SSA_NAME even after this check.
I guess if the definition bb is the same as stmt's bb, it can, similarly
if get_phi_state (var) == NEED_PHI_STATE_NO (plus the dominated_by_p check
above), or if bitmap_bit_p (get_def_blocks_for (var)->livein_blocks, gimple_bb
(stmt)->index).  Any other cases?


  parent reply	other threads:[~2011-07-01 14:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01  0:00 [Bug tree-optimization/49602] New: " arthur.j.odwyer at gmail dot com
2011-07-01  7:05 ` [Bug middle-end/49602] [4.7 Regression] " rguenth at gcc dot gnu.org
2011-07-01 11:16 ` jakub at gcc dot gnu.org
2011-07-01 14:53 ` jakub at gcc dot gnu.org [this message]
2011-07-04 17:21 ` [Bug debug/49602] " jakub at gcc dot gnu.org
2011-07-04 18:25 ` 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-49602-4-JbyRRLsVVm@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).