public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/56515] New: location references block not in block tree, verify_gimple failed (LTO + profile)
@ 2013-03-04  5:18 d.g.gorbachev at gmail dot com
  2013-03-04  5:22 ` [Bug lto/56515] " d.g.gorbachev at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2013-03-04  5:18 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56515
           Summary: location references block not in block tree,
                    verify_gimple failed (LTO + profile)
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: d.g.gorbachev@gmail.com


GCC 4.8.0 20130303 (experimental):

foo.c: In function 'foo':
foo.c:1:6: error: location references block not in block tree
 void foo(void) { }
      ^
# .MEM_10 = VDEF <.MEM_6(D)>
bar = 1;

foo.c:1:6: internal compiler error: verify_gimple failed
0x85df8f2 verify_gimple_in_cfg(function*)
    ../../gcc-4.8/gcc/tree-cfg.c:4727
0x84d520c execute_function_todo
    ../../gcc-4.8/gcc/passes.c:1963
0x84d455d do_per_function
    ../../gcc-4.8/gcc/passes.c:1701
0x84d532d execute_todo
    ../../gcc-4.8/gcc/passes.c:1996
0x84d57a1 execute_one_ipa_transform_pass
    ../../gcc-4.8/gcc/passes.c:2182
0x84d5873 execute_all_ipa_transforms()
    ../../gcc-4.8/gcc/passes.c:2208
0x8206775 expand_function
    ../../gcc-4.8/gcc/cgraphunit.c:1633
0x8206cda expand_all_functions
    ../../gcc-4.8/gcc/cgraphunit.c:1744
0x8207763 compile()
    ../../gcc-4.8/gcc/cgraphunit.c:2042
0x816b85d lto_main()
    ../../gcc-4.8/gcc/lto/lto.c:3396


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug lto/56515] location references block not in block tree, verify_gimple failed (LTO + profile)
  2013-03-04  5:18 [Bug lto/56515] New: location references block not in block tree, verify_gimple failed (LTO + profile) d.g.gorbachev at gmail dot com
@ 2013-03-04  5:22 ` d.g.gorbachev at gmail dot com
  2013-03-04  5:23 ` d.g.gorbachev at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2013-03-04  5:22 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> 2013-03-04 05:20:49 UTC ---
Created attachment 29575
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29575
Bt from 4.7.3

GCC 4.8.0 20130127 (r195497) fails, too; 20130113 (r195137) - ok.
GCC 4.8.0 20120916 (r191367) and earlier builds / versions (4.7, 4.6) fail with
sigsegv in prepend_lexical_block().


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug lto/56515] location references block not in block tree, verify_gimple failed (LTO + profile)
  2013-03-04  5:18 [Bug lto/56515] New: location references block not in block tree, verify_gimple failed (LTO + profile) 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
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2013-03-04  5:23 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> 2013-03-04 05:22:09 UTC ---
Created attachment 29576
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29576
Testcase


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug lto/56515] [4.8 Regression] location references block not in block tree, verify_gimple failed (LTO + profile)
  2013-03-04  5:18 [Bug lto/56515] New: location references block not in block tree, verify_gimple failed (LTO + profile) 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 ` rguenth at gcc dot gnu.org
  2013-03-04 12:11 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-03-04 11:03 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2013-03-04
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.8.0
            Summary|location references block   |[4.8 Regression] location
                   |not in block tree,          |references block not in
                   |verify_gimple failed (LTO + |block tree, verify_gimple
                   |profile)                    |failed (LTO + profile)
     Ever Confirmed|0                           |1

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-04 11:03:04 UTC ---
Confirmed.  I'll try to nail it down.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug lto/56515] [4.8 Regression] location references block not in block tree, verify_gimple failed (LTO + profile)
  2013-03-04  5:18 [Bug lto/56515] New: location references block not in block tree, verify_gimple failed (LTO + profile) d.g.gorbachev at gmail dot com
                   ` (2 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-03-04 12:11 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-04 12:10:32 UTC ---
We inline __gcov_indirect_call_profiler:

2
foo.o 4
211 1fa7ccac167ed480 PREVAILING_DEF foo
218 1fa7ccac167ed480 RESOLVED_EXEC __gcov_merge_add
220 1fa7ccac167ed480 RESOLVED_IR __gcov_indirect_call_profiler
229 1fa7ccac167ed480 RESOLVED_EXEC __gcov_init
bar.o 2
165 fdbab47f5593e985 PREVAILING_DEF_IRONLY __gcov_indirect_call_profiler
186 fdbab47f5593e985 PREVAILING_DEF_IRONLY bar

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).


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug lto/56515] [4.8 Regression] location references block not in block tree, verify_gimple failed (LTO + profile)
  2013-03-04  5:18 [Bug lto/56515] New: location references block not in block tree, verify_gimple failed (LTO + profile) d.g.gorbachev at gmail dot com
                   ` (3 preceding siblings ...)
  2013-03-04 12:11 ` rguenth at gcc dot gnu.org
@ 2013-03-04 16:07 ` hubicka at ucw dot cz
  2013-03-05  9:21 ` rguenth at gcc dot gnu.org
  2013-03-05  9:21 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: hubicka at ucw dot cz @ 2013-03-04 16:07 UTC (permalink / raw)
  To: gcc-bugs


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug lto/56515] [4.8 Regression] location references block not in block tree, verify_gimple failed (LTO + profile)
  2013-03-04  5:18 [Bug lto/56515] New: location references block not in block tree, verify_gimple failed (LTO + profile) d.g.gorbachev at gmail dot com
                   ` (4 preceding siblings ...)
  2013-03-04 16:07 ` hubicka at ucw dot cz
@ 2013-03-05  9:21 ` rguenth at gcc dot gnu.org
  2013-03-05  9:21 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-03-05  9:21 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-05 09:20:36 UTC ---
Author: rguenth
Date: Tue Mar  5 09:20:30 2013
New Revision: 196452

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196452
Log:
2013-03-05  Richard Biener  <rguenther@suse.de>

    PR lto/56515
    * tree-inline.c (remap_blocks_to_null): New function.
    (expand_call_inline): When expanding a call stmt without
    an associated block inline remap all callee blocks to NULL.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-inline.c


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug lto/56515] [4.8 Regression] location references block not in block tree, verify_gimple failed (LTO + profile)
  2013-03-04  5:18 [Bug lto/56515] New: location references block not in block tree, verify_gimple failed (LTO + profile) d.g.gorbachev at gmail dot com
                   ` (5 preceding siblings ...)
  2013-03-05  9:21 ` rguenth at gcc dot gnu.org
@ 2013-03-05  9:21 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-03-05  9:21 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-05 09:21:10 UTC ---
Fixed.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-03-05  9:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-04  5:18 [Bug lto/56515] New: location references block not in block tree, verify_gimple failed (LTO + profile) 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
2013-03-05  9:21 ` rguenth at gcc dot gnu.org
2013-03-05  9:21 ` rguenth at gcc dot gnu.org

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).