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 middle-end/42110] [4.5 Regression] ICE with inlining
Date: Fri, 04 Dec 2009 13:00:00 -0000	[thread overview]
Message-ID: <20091204130035.14143.qmail@sourceware.org> (raw)
In-Reply-To: <bug-42110-1771@http.gcc.gnu.org/bugzilla/>



------- Comment #6 from rguenth at gcc dot gnu dot org  2009-12-04 13:00 -------
So we come in

tree-inline.c:

1695                      if (id->transform_call_graph_edges ==
CB_CGE_MOVE_CLONES)
1696                        cgraph_create_edge_including_clones

as we figure out a new direct call.  But while
cgraph_create_edge_including_clones
creates a new edge with CIF_ORIGINALLY_INDIRECT_CALL failed reason it does
not create a new clone for the callee even though the callee has
global.inlined_to set (though it isn't a clone appearantly:

A* A::fooA()/7(-1) @0xb7cb9924 (inline copy in void baz()/1)
availability:available 17 time, 12 benefit 6 size, 3 benefit reachable body
finalized inlinable
  called by: void B<<anonymous> >::fooB(char) [with int <anonymous> = 0]/5
(1.00 per call) (can throw external) void B<<anonymous> >::fooB(char) [with int
<anonymous> = 0]/6 (1.00 per call) (inlined) (can throw external) 
  calls: bool foo()/4 (1.00 per call) (can throw external) bool foo()/4 (0.39
per call) (can throw external) 

so we shouldn't create a new direct call edge to an inline-copy node but
to it's real node.  Somehow.  Maybe we removed that node already?
Indeed.  We remove it's clone_of here:

Breakpoint 7, cgraph_remove_node (node=0xb7cb9384)
    at /home/richard/src/trunk/gcc/cgraph.c:1282
gdb) up
#1  0x08ae1705 in cgraph_remove_unreachable_nodes (before_inlining_p=0 '\000', 
    file=0x0) at /home/richard/src/trunk/gcc/ipa.c:213
213                 cgraph_remove_node (node);
(gdb) 
#2  0x08ab1fd1 in cgraph_optimize ()
    at /home/richard/src/trunk/gcc/cgraphunit.c:1791
1791      cgraph_remove_unreachable_nodes (false, dump_file);
(gdb) 
#3  0x08aaf8e5 in cgraph_finalize_compilation_unit ()
    at /home/richard/src/trunk/gcc/cgraphunit.c:1083
1083      cgraph_optimize ();

and the callee node looks like this before we proceed with removing:

A* A::fooA()/7(-1) @0xb7cb9924 (inline copy in void baz()/1) (clone of A*
A::fooA()/0) availability:available 17 time, 12 benefit 6 size, 3 benefit
reachable body finalized inlinable
  called by: void B<<anonymous> >::fooB(char) [with int <anonymous> = 0]/6
(1.00 per call) (inlined) (can throw external) 
  calls: bool foo()/4 (1.00 per call) (can throw external) bool foo()/4 (0.39
per call) (can throw external) 

no idea if keeping the clone_of would have magically solved the problem
here.


-- 


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


  parent reply	other threads:[~2009-12-04 13:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-19 20:35 [Bug middle-end/42110] New: " reichelt at gcc dot gnu dot org
2009-11-19 20:36 ` [Bug middle-end/42110] " reichelt at gcc dot gnu dot org
2009-11-20 10:58 ` rguenth at gcc dot gnu dot org
2009-11-27 11:25 ` rguenth at gcc dot gnu dot org
2009-11-27 11:35 ` rguenth at gcc dot gnu dot org
2009-12-04 12:03 ` rguenth at gcc dot gnu dot org
2009-12-04 12:06 ` rguenth at gcc dot gnu dot org
2009-12-04 13:00 ` rguenth at gcc dot gnu dot org [this message]
2009-12-04 13:45 ` hjl dot tools at gmail dot com
2009-12-08 15:57 ` hubicka at gcc dot gnu dot org
2009-12-08 16:01 ` rguenth at gcc dot gnu dot org
2009-12-08 16:35 ` hubicka at ucw dot cz
2009-12-08 16:36 ` hubicka at gcc dot gnu dot org
2009-12-10 20:51 ` hubicka at gcc dot gnu dot org
2009-12-11 11:18 ` hubicka at gcc dot gnu dot org
2009-12-11 23:41 ` hjl 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=20091204130035.14143.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).