public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dberlin at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/17924] [4.0 Regression] gcc.dg/debug/dwarf2/dwarf-die7.c fails
Date: Fri, 31 Dec 2004 22:46:00 -0000	[thread overview]
Message-ID: <20041231224637.27382.qmail@sourceware.org> (raw)
In-Reply-To: <20041010202301.17924.pinskia@gcc.gnu.org>


------- Additional Comments From dberlin at gcc dot gnu dot org  2004-12-31 22:46 -------
Okay.
What really happens here is that the blocks aren't getting marked properly
because we rearrange the block tree and then the used flags aren't set when the
subblocks of a block are used (which is what we expect in the debug outputters).

However, marking the blocks properly (see the attached patch, which fixes
dwarf-die-7) exposes bugs, and  I really need someone like Jason to tell me what
the heck is going on.

The bug it exposes is as follows (and maybe the real bug is in the inliner, i've
attached a testcase here).

When we inline a C++ constructor that isn't going to be output, we get the
following stuff:

a block for the inlined constructor, with an abstract origin of:
  a decl named __comp_ctor with an abstract origin of:
    a decl named bad_typeid

we call gen_inlined_subroutine_die on the block, which calls block_ultimate_origin.
block_ultimate_origin returns *the __comp_ctor* decl.

We call dwarf2out_abstract_function on the __comp_ctor decl, which outputs a die
for the bad_typeid decl (which is the real origin).
Then we try to add an abstract attribute for the *comp_ctor* decl, because
that's what we think the ultimate origin of the block was. 
This aborts, because we have no die for that decl (because it's not the real
ultimate origin of the block).

When compiled with 3.4, we end up with

a block for the inlined constructor, with an abstract origin of:
    a decl named bad_typeid

Which works properly.

I get the feeling that block_ultimate_origin of the block is supposed to be the
same as it was in 3.4.

But the documentation doesn't help me here.

Jason, if you can tell me what the block_ultimate_origin of the block is
supposed to really be (Ie is it correct or incorrect), i can fix this bug.

You need to apply the patch to see the bug, because without the patch, we simply
don't try to output an inlined subroutine die because the superblock isn't
marked as used, etc.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com
            Version|4.0.0                       |3.4.4


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


  parent reply	other threads:[~2004-12-31 22:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-10 20:23 [Bug debug/17924] New: " pinskia at gcc dot gnu dot org
2004-10-10 20:23 ` [Bug debug/17924] " pinskia at gcc dot gnu dot org
2004-10-11  2:05 ` pinskia at gcc dot gnu dot org
2004-10-15  5:00 ` bje at gcc dot gnu dot org
2004-10-15  6:07 ` bje at gcc dot gnu dot org
2004-10-15  6:43 ` bje at gcc dot gnu dot org
2004-12-02  5:43 ` bje at gcc dot gnu dot org
2004-12-02 16:06 ` hubicka at ucw dot cz
2004-12-03  1:17 ` dberlin at gcc dot gnu dot org
2004-12-29 20:54 ` pinskia at gcc dot gnu dot org
2004-12-31 22:26 ` dberlin at gcc dot gnu dot org
2004-12-31 22:46 ` dberlin at gcc dot gnu dot org [this message]
2005-01-01  3:17 ` dberlin at gcc dot gnu dot org
2005-01-01 12:16 ` jason at redhat dot com
2005-01-04  1:54 ` cvs-commit at gcc dot gnu dot org
2005-01-04  3:10 ` dberlin at gcc dot gnu dot 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=20041231224637.27382.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).