public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/44832] [4.6 Regression] -fcompare-debug failure for C++ i386.c
Date: Thu, 08 Jul 2010 12:33:00 -0000	[thread overview]
Message-ID: <20100708123312.5402.qmail@sourceware.org> (raw)
In-Reply-To: <bug-44832-5394@http.gcc.gnu.org/bugzilla/>



------- Comment #43 from rguenth at gcc dot gnu dot org  2010-07-08 12:33 -------
I placed a debug_generic_expr () in copy_node_stat and re-directed output ...

Now, I see that in the non-debug case we are copying the LABEL_DECL while
copying statements while in the debug case we are copying it while
copying the block tree.  We have to preserve used labels in
the block tree it's just not trivial to do unless we resort to setting
TREE_USED.

Which would be the following, which also fixes the failure.

Index: tree-ssa-live.c
===================================================================
--- tree-ssa-live.c     (revision 161949)
+++ tree-ssa-live.c     (working copy)
@@ -384,6 +384,9 @@ mark_all_vars_used_1 (tree *tp, int *wal
       set_is_used (t);
     }

+  if (TREE_CODE (t) == LABEL_DECL)
+    TREE_USED (t) = true;
+
   if (IS_TYPE_OR_DECL_P (t))
     *walk_subtrees = 0;

@@ -448,6 +451,13 @@ remove_unused_scope_block_p (tree scope)
       else if (TREE_CODE (*t) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (*t))
        unused = false;

+      /* Labels that are still used in the IL we have to preserve in
+         the block tree as well, otherwise we risk having different
+        ordering in debug vs. non-debug builds during inlining
+        or versioning.  */
+      else if (TREE_CODE (*t) == LABEL_DECL && TREE_USED (*t))
+       unused = false;
+
       /* Remove everything we don't generate debug info for.  */
       else if (DECL_IGNORED_P (*t))
        {


we don't have var annotations for LABEL_DECLs, so a proper solution
would use a bitmap of UIDs to preserve here I guess.


-- 


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


  parent reply	other threads:[~2010-07-08 12:33 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-06  4:39 [Bug bootstrap/44832] New: --enable-build-with-cxx Bootstrap comparison failure amylaar at gcc dot gnu dot org
2010-07-06  5:25 ` [Bug bootstrap/44832] " amylaar at gcc dot gnu dot org
2010-07-06 10:23 ` rguenth at gcc dot gnu dot org
2010-07-06 13:18 ` amylaar at gcc dot gnu dot org
2010-07-06 14:09 ` [Bug debug/44832] [4.6 Regression] -fcompare-debug failure for C++ i386.c rguenth at gcc dot gnu dot org
2010-07-06 14:43 ` amylaar at gcc dot gnu dot org
2010-07-06 14:51 ` amylaar at gcc dot gnu dot org
2010-07-06 15:03 ` amylaar at gcc dot gnu dot org
2010-07-06 18:21 ` amylaar at gcc dot gnu dot org
2010-07-07  1:42 ` amylaar at gcc dot gnu dot org
2010-07-07  2:00 ` amylaar at gcc dot gnu dot org
2010-07-07  2:16 ` amylaar at gcc dot gnu dot org
2010-07-07  8:38 ` rguenther at suse dot de
2010-07-07 13:16 ` amylaar at gcc dot gnu dot org
2010-07-07 13:23 ` amylaar at gcc dot gnu dot org
2010-07-07 13:23 ` jakub at gcc dot gnu dot org
2010-07-07 13:25 ` rguenther at suse dot de
2010-07-07 13:49 ` amylaar at gcc dot gnu dot org
2010-07-07 13:55 ` jakub at gcc dot gnu dot org
2010-07-07 13:57 ` rguenth at gcc dot gnu dot org
2010-07-07 14:00 ` amylaar at gcc dot gnu dot org
2010-07-07 14:02 ` amylaar at gcc dot gnu dot org
2010-07-07 14:07 ` amylaar at gcc dot gnu dot org
2010-07-07 14:25 ` jakub at gcc dot gnu dot org
2010-07-07 14:35 ` rguenth at gcc dot gnu dot org
2010-07-07 14:48 ` rguenth at gcc dot gnu dot org
2010-07-07 14:48 ` amylaar at gcc dot gnu dot org
2010-07-07 14:57 ` amylaar at gcc dot gnu dot org
2010-07-07 15:00 ` rguenth at gcc dot gnu dot org
2010-07-07 15:06 ` amylaar at gcc dot gnu dot org
2010-07-07 17:28 ` amylaar at gcc dot gnu dot org
2010-07-07 17:51 ` amylaar at gcc dot gnu dot org
2010-07-07 19:53 ` amylaar at gcc dot gnu dot org
2010-07-08  1:00 ` amylaar at gcc dot gnu dot org
2010-07-08  1:11 ` amylaar at gcc dot gnu dot org
2010-07-08  8:46 ` rguenther at suse dot de
2010-07-08 11:04 ` amylaar at gcc dot gnu dot org
2010-07-08 11:32 ` rguenther at suse dot de
2010-07-08 11:45 ` rguenth at gcc dot gnu dot org
2010-07-08 11:49 ` rguenth at gcc dot gnu dot org
2010-07-08 11:53 ` rguenth at gcc dot gnu dot org
2010-07-08 12:01 ` amylaar at gcc dot gnu dot org
2010-07-08 12:08 ` amylaar at gcc dot gnu dot org
2010-07-08 12:33 ` rguenth at gcc dot gnu dot org [this message]
2010-07-08 15:54 ` amylaar at gcc dot gnu dot org
2010-07-08 16:05 ` rguenther at suse dot de
2010-07-08 17:21 ` amylaar at gcc dot gnu dot org
2010-07-08 20:00 ` amylaar at gcc dot gnu dot org
2010-07-09  3:38 ` amylaar at gcc dot gnu dot org
2010-07-09 10:02 ` amylaar at gcc dot gnu dot org
2010-07-09 11:38 ` amylaar at gcc dot gnu dot org
2010-07-09 11:48 ` rguenth at gcc dot gnu dot org
2010-07-09 15:07 ` amylaar at gcc dot gnu dot org
2010-07-10  4:44 ` amylaar at gcc dot gnu dot org
2010-07-10  9:41 ` amylaar at gcc dot gnu dot org
2010-07-12  8:06 ` rguenth at gcc dot gnu dot org
2010-07-13 21:56 ` amylaar at gcc dot gnu dot org
     [not found] <bug-44832-4@http.gcc.gnu.org/bugzilla/>
2010-10-13 20:26 ` aoliva 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=20100708123312.5402.qmail@sourceware.org \
    --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).