public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at ucw dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/56515] [4.8 Regression] location references block not in block tree, verify_gimple failed (LTO + profile)
Date: Mon, 04 Mar 2013 16:07:00 -0000	[thread overview]
Message-ID: <bug-56515-4-ZLW3gxOXOw@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-56515-4@http.gcc.gnu.org/bugzilla/>


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

--- Comment #5 from Jan Hubicka <hubicka at ucw dot cz> 2013-03-04 16:06:25 UTC ---
> We build the function decls via build_fn_decl which ends up using
> input_location of the first random function we are processing.
> 
> But that doesn't seem to be the issue after all ...
> 
> The issue is that we do in expand_call_inline:
> 
>   /* Build a block containing code to initialize the arguments, the
>      actual inline expansion of the body, and a label for the return
>      statements within the function to jump to.  The type of the
>      statement expression is the return type of the function call.  */
>   id->block = make_node (BLOCK);
>   BLOCK_ABSTRACT_ORIGIN (id->block) = fn;
>   BLOCK_SOURCE_LOCATION (id->block) = input_location;
>   if (gimple_block (stmt))
>     prepend_lexical_block (gimple_block (stmt), id->block);
> 
> that is, we only link the copied BLOCK tree into the caller BLOCK tree if
> the call stmt had an associated BLOCK.  Which isn't the case for the
> calls created by the middle-end (profile instrumentation in this case).

Hmm, yeah, thre are few cases where we sort of assume that each call has
a block.  I wonder what should we do here, just prepend the block for the 
outermost block of the caller function then?

In general however LTO of libgcov is not supposed to work same way as libgcc or
glibc does not work. We can't LTO yet any functions where middle-end invent
calls post LTO streaming.  I blieve we still do so for libgcov for fork calls.

Honza


  parent reply	other threads:[~2013-03-04 16:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04  5:18 [Bug lto/56515] New: " d.g.gorbachev at gmail dot com
2013-03-04  5:22 ` [Bug lto/56515] " d.g.gorbachev at gmail dot com
2013-03-04  5:23 ` d.g.gorbachev at gmail dot com
2013-03-04 11:03 ` [Bug lto/56515] [4.8 Regression] " rguenth at gcc dot gnu.org
2013-03-04 12:11 ` rguenth at gcc dot gnu.org
2013-03-04 16:07 ` hubicka at ucw dot cz [this message]
2013-03-05  9:21 ` rguenth at gcc dot gnu.org
2013-03-05  9:21 ` rguenth 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-56515-4-ZLW3gxOXOw@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).