From: Aldy Hernandez <aldyh@redhat.com>
To: Jason Merrill <jason@redhat.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [debug-early] equate new DIE with DW_AT_specificationto a previous declaration
Date: Wed, 18 Mar 2015 15:51:00 -0000 [thread overview]
Message-ID: <55099EEB.70402@redhat.com> (raw)
In-Reply-To: <5508DF27.9060607@redhat.com>
On 03/17/2015 07:12 PM, Jason Merrill wrote:
> On 03/17/2015 03:58 PM, Aldy Hernandez wrote:
>> The problem is that, for -fno-implicit-templates, the decl is now
>> DECL_EXTERNAL, which means we never equate this new "DIE with
>> DW_AT_specification" to the DECL. That is, we never fall through here:
>>
>> else if (!DECL_EXTERNAL (decl))
>> {
>> HOST_WIDE_INT cfa_fb_offset;
>>
>> struct function *fun = DECL_STRUCT_FUNCTION (decl);
>>
>> if (!old_die || !get_AT (old_die, DW_AT_inline))
>> equate_decl_number_to_die (decl, subr_die);
>>
>> However, when we call gen_subprogram_die() the third time through the
>> outlining_inline_function hook (late debug), we again try to add a
>> DW_AT_specification to the DIE cached from the first time around, but
>> this time we ICE because we're not supposed to have multiple
>> DW_AT_specification's pointing to the same DIE (the old original DIE).
>
> Why are we outlining a DECL_EXTERNAL function?
SRA is analyzing Object<int>::Method() and noticing that `this' is never
used, so it's trying to rewrite the call to avoid passing `this' (by
creating a clone).
SRA has no restrictions on whether a function is DECL_EXTERNAL. For
that matter, the SRA pass is called on all functions that have a gimple
body, irregardless of DECL_EXTERNAL, courtesy of the pass manager:
if (node->has_gimple_body_p ())
callback (DECL_STRUCT_FUNCTION (node->decl), data);
...and since Object<int>::Method() has a gimple body even though it is
marked DECL_EXTERNAL...we get the call into dwarf2out_abstract_decl.
>
> Incidentally,
>
>> /* If we have no location information, this must be a
>> partially generated DIE from early dwarf generation.
>> Fall through and generate it. */
>
> Why aren't we checking dumped_early here?
Good point. I'll add an assert.
Aldy
next prev parent reply other threads:[~2015-03-18 15:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-17 19:58 Aldy Hernandez
2015-03-18 2:12 ` Jason Merrill
2015-03-18 15:51 ` Aldy Hernandez [this message]
2015-04-03 14:41 ` Jason Merrill
2015-04-10 21:10 ` Aldy Hernandez
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=55099EEB.70402@redhat.com \
--to=aldyh@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@redhat.com \
/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).