[Bug rtl-optimization/45621] [4.6 Regression] ICE: verify_cgraph_node failed: inlined_to pointer is set but no predecessors found with -fipa-cp-clone -flto

2010-10-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45621

--- Comment #6 from Jan Hubicka hubicka at gcc dot gnu.org 2010-10-14 
18:59:58 UTC ---
The testing went fine, I just wanted to give more tought if some cheaper self
testing can be made instead of keeping clone info and then forgot about the
patch.
Will re-test and commit.


[Bug rtl-optimization/45621] [4.6 Regression] ICE: verify_cgraph_node failed: inlined_to pointer is set but no predecessors found with -fipa-cp-clone -flto

2010-10-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45621

--- Comment #7 from Jan Hubicka hubicka at gcc dot gnu.org 2010-10-15 
01:20:59 UTC ---
Author: hubicka
Date: Fri Oct 15 01:20:55 2010
New Revision: 165492

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=165492
Log:

PR middle-end/45621
* g++.dg/lto/pr45621.h : New.
* g++.dg/lto/pr45621_0.C: New.
* g++.dg/lto/pr45621_1.C: New.
* cgraph.c (cgraph_update_edges_for_call_stmt_node): When new call is
redirected to clone, be happy.
* cgraph.h (cgraph node): Enable former_clone_of unconditinally.
* cgraphunit.c (verify_cgraph_node, cgraph_materialize_clone): Handle
former_clone_of unconditinally.

Added:
trunk/gcc/testsuite/g++.dg/lto/pr45621.h
trunk/gcc/testsuite/g++.dg/lto/pr45621_0.C
trunk/gcc/testsuite/g++.dg/lto/pr45621_1.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cgraph.c
trunk/gcc/cgraph.h
trunk/gcc/cgraphunit.c
trunk/gcc/testsuite/ChangeLog


[Bug rtl-optimization/45621] [4.6 Regression] ICE: verify_cgraph_node failed: inlined_to pointer is set but no predecessors found with -fipa-cp-clone -flto

2010-10-14 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45621

Jan Hubicka hubicka at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #8 from Jan Hubicka hubicka at gcc dot gnu.org 2010-10-15 
01:24:04 UTC ---
Fixed.


[Bug rtl-optimization/45621] [4.6 Regression] ICE: verify_cgraph_node failed: inlined_to pointer is set but no predecessors found with -fipa-cp-clone -flto

2010-09-29 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45621

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P1

--- Comment #5 from Richard Guenther rguenth at gcc dot gnu.org 2010-09-29 
15:29:31 UTC ---
Any update?


[Bug rtl-optimization/45621] [4.6 Regression] ICE: verify_cgraph_node failed: inlined_to pointer is set but no predecessors found with -fipa-cp-clone -flto

2010-09-17 Thread hubicka at gcc dot gnu dot org


--- Comment #4 from hubicka at gcc dot gnu dot org  2010-09-17 12:17 ---
Created an attachment (id=21818)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21818action=view)
proposed patch


-- 


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



[Bug rtl-optimization/45621] [4.6 Regression] ICE: verify_cgraph_node failed: inlined_to pointer is set but no predecessors found with -fipa-cp-clone -flto

2010-09-16 Thread hubicka at gcc dot gnu dot org


--- Comment #2 from hubicka at gcc dot gnu dot org  2010-09-17 01:05 ---
OK, problem is that we both devirtualize and clone the destination function.
Then when producing clone, we run into:
cgraph_update_edges_for_call_stmt_node (struct cgraph_node *node,
gimple old_stmt, tree old_call, gimple
new_stmt)
{
  tree new_call = (is_gimple_call (new_stmt)) ? gimple_call_fndecl (new_stmt) :
0;

  /* We are seeing indirect calls, then there is nothing to update.  */
  if (!new_call  !old_call)
return;
  /* See if we turned indirect call into direct call or folded call to one
builtin
 into different bultin.  */
  if (old_call != new_call)
{ 
  struct cgraph_edge *e = cgraph_edge (node, old_stmt);
  struct cgraph_edge *ne = NULL;
  gcov_type count;
  int frequency;
  int loop_nest;

  if (e)
{ 
  /* See if the edge is already there and has the correct callee.  It
 might be so because of indirect inlining has already updated
 it.  */
  if (new_call  e-callee  e-callee-decl == new_call)
return;

  /* Otherwise remove edge and create new one; we can't simply redirect
 since function has changed, so inline plan and other information
 attached to edge is invalid.  */

and kill the inline plan.  This code is intended to handle bulitins, I guess
we will need to look out if the decl can be redirected to decl in the function.

Honza


-- 


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



[Bug rtl-optimization/45621] [4.6 Regression] ICE: verify_cgraph_node failed: inlined_to pointer is set but no predecessors found with -fipa-cp-clone -flto

2010-09-16 Thread hubicka at gcc dot gnu dot org


--- Comment #3 from hubicka at gcc dot gnu dot org  2010-09-17 01:07 ---
testing patch.


-- 

hubicka at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |hubicka at gcc dot gnu dot
   |dot org |org
 Status|UNCONFIRMED |ASSIGNED
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2010-09-17 01:07:45
   date||


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



[Bug rtl-optimization/45621] [4.6 Regression] ICE: verify_cgraph_node failed: inlined_to pointer is set but no predecessors found with -fipa-cp-clone -flto

2010-09-10 Thread rguenth at gcc dot gnu dot org


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu dot
   ||org, jamborm at gcc dot gnu
   ||dot org
   Target Milestone|--- |4.6.0


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



[Bug rtl-optimization/45621] [4.6 Regression] ICE: verify_cgraph_node failed: inlined_to pointer is set but no predecessors found with -fipa-cp-clone -flto

2010-09-09 Thread zsojka at seznam dot cz


--- Comment #1 from zsojka at seznam dot cz  2010-09-09 19:35 ---
Created an attachment (id=21757)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21757action=view)
archive with reduced testcase

$ g++ -O2 -fipa-cp-clone -flto -nostdlib -r file1.cpp file2.cpp

- file1.cpp -
#include header.h

void
foo ()
{
  s.v1 ();
  s.m ();
}
-
- file2.cpp -
#include header.h

void
S::v1 ()
{
  v2 ();
}

void
S::m ()
{
  v1 ();
}
-
- header.h -
struct S
{
  void m ();
  virtual void v1 ();
  virtual void v2 ();
};

extern S s;


I pressed Commit too early, so there is the rest:
Tested revisions:
r164077 - crash
r164096 - crash
r161659 - OK


-- 


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