[Bug middle-end/42110] [4.5 Regression] ICE with inlining

2009-12-11 Thread hjl at gcc dot gnu dot org


--- Comment #14 from hjl at gcc dot gnu dot org  2009-12-11 23:38 ---
Subject: Bug 42110

Author: hjl
Date: Fri Dec 11 23:36:24 2009
New Revision: 155184

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155184
Log:
Backport testcases from trunk.

2009-12-11  H.J. Lu  

Backport from mainline:
2009-12-11  Dodji Seketeli  

PR c++/42225
* g++.dg/template/typedef24.C: New test.
* g++.dg/template/typedef25.C: New test.

2009-12-11  Dodji Seketeli  

PR c++/42251
* g++.dg/template/const3.C: New test.

2009-12-10  Jakub Jelinek  

PR c++/42317
* g++.dg/opt/dtor2.C: New test.
* g++.dg/opt/dtor2.h: New file.
* g++.dg/opt/dtor2-aux.cc: New file.

2009-12-10  Jan Hubicka  

PR middle-end/42110
* g++.dg/torture/pr42110.C: new file.

2009-12-07  Jakub Jelinek  

PR debug/42244
* gcc.dg/debug/pr42244.c: New test.

2009-12-04  David Daney  

PR rtl-optimization/42164
* gcc.c-torture/compile/pr42164.c: New test.

2009-12-03  Jason Merrill  

PR c++/41611
* g++.dg/abi/guard2.C: New.

2009-12-03  Dodji Seketeli  

PR c++/42217
* g++.dg/other/bitfield4.C: New test.

2009-12-03  Jakub Jelinek  

PR c++/42256
* g++.dg/inherit/thunk11.C: New test.
* g++.dg/inherit/thunk11.h: New file.
* g++.dg/inherit/thunk11-aux.cc: New file.

2009-12-01  Martin Jambor  

PR tree-optimization/42237
* gcc.c-torture/compile/pr42237.c: New test.

2009-12-01  Paolo Carlini  

PR c++/42057
* g++.dg/parse/crash54.C: New.

2009-11-30  Martin Jambor  

PR middle-end/42196
* gcc.c-torture/compile/pr42196-1.c: New test.
* gcc.c-torture/compile/pr42196-2.c: New test.
* gcc.c-torture/compile/pr42196-3.c: New test.

2009-11-30  Dodji Seketeli  

PR c++/42069
* g++.dg/template/typedef23.C: New test.

2009-11-29  H.J. Lu  

PR tree-optimization/41961
* g++.dg/tree-ssa/pr41961.C: New.

2009-11-29  Ira Rosen  

PR tree-optimization/42193
* gcc.dg/vect/pr42193.c: New test.

2009-11-28  Richard Guenther  

PR tree-optimization/42183
* g++.dg/torture/pr42183.C: New testcase.

2009-11-27  Martin Jambor  

PR middle-end/42006
* gcc.c-torture/execute/pr42006.c: New test.

2009-11-27  Michael Matz  

PR rtl-optimization/42084
* gcc.dg/pr42084.c: New test.

2009-11-27  Michael Matz  

PR c++/41906
* g++.dg/tree-ssa/pr41906.C: New testcase.

2009-11-26  Michael Matz  

PR tree-optimization/41905
* g++.dg/tree-ssa/pr41905.C: New testcase.

2009-11-24  Richard Guenther  

PR tree-optimization/42142
* gcc.c-torture/execute/pr42142.c: New testcase.

2009-11-24  Martin Jambor  

PR tree-optimization/42154
* gcc.c-torture/execute/pr42154.c: New test.

2009-11-21  Martin Jambor  

PR middle-end/42025
* gcc.c-torture/compile/pr42025-1.c: New test.
* gcc.c-torture/compile/pr42025-2.c: New test.

2009-11-21  Jakub Jelinek  

PR tree-optimization/42078
* gcc.dg/pr42078.c: New test.

Added:
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/abi/guard2.C
  - copied unchanged from r155170, trunk/gcc/testsuite/g++.dg/abi/guard2.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/inherit/thunk11-aux.cc
  - copied unchanged from r155170,
trunk/gcc/testsuite/g++.dg/inherit/thunk11-aux.cc
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/inherit/thunk11.C
  - copied unchanged from r155170,
trunk/gcc/testsuite/g++.dg/inherit/thunk11.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/inherit/thunk11.h
  - copied unchanged from r155170,
trunk/gcc/testsuite/g++.dg/inherit/thunk11.h
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/opt/dtor2-aux.cc
  - copied unchanged from r155170,
trunk/gcc/testsuite/g++.dg/opt/dtor2-aux.cc
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/opt/dtor2.C
  - copied unchanged from r155170, trunk/gcc/testsuite/g++.dg/opt/dtor2.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/opt/dtor2.h
  - copied unchanged from r155170, trunk/gcc/testsuite/g++.dg/opt/dtor2.h
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/other/bitfield4.C
  - copied unchanged from r155170,
trunk/gcc/testsuite/g++.dg/other/bitfield4.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/parse/crash54.C
  - copied unchanged from r155172,
trunk/gcc/testsuite/g++.dg/parse/crash54.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/const3.C
  - copied unchanged from r155170,
trunk/gcc/testsuite/g++.dg/template/const3.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/typedef23.C
  - copied unc

[Bug middle-end/42110] [4.5 Regression] ICE with inlining

2009-12-11 Thread hubicka at gcc dot gnu dot org


--- Comment #13 from hubicka at gcc dot gnu dot org  2009-12-11 11:17 
---
Fixed.


-- 

hubicka at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug middle-end/42110] [4.5 Regression] ICE with inlining

2009-12-10 Thread hubicka at gcc dot gnu dot org


--- Comment #12 from hubicka at gcc dot gnu dot org  2009-12-10 20:51 
---
Subject: Bug 42110

Author: hubicka
Date: Thu Dec 10 20:50:47 2009
New Revision: 155140

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155140
Log:

PR middle-end/42228
PR middle-end/42110
* cgraph.c (cgraph_create_edge_including_clones): Add old_stmt
parameter;
update edge if it already exists.
(cgraph_remove_node): Handle correctly cases where we are removing node
having
clones.
* cgraph.h (cgraph_create_edge_including_clones): Declare.
(verify_cgraph_node): Add missing error_found = true code.
(cgraph_materialize_all_clones): Remove call edges of dead nodes.
* ipa.c (cgraph_remove_unreachable_nodes): Correctly look for master
clone; fix double linked list removal.
* tree-inline.c (copy_bb): Update cgraph_create_edge_including_clones
call;
fix frequency of newly created edge.

* g++.dg/torture/pr42110.C: new file.

Added:
trunk/gcc/testsuite/g++.dg/torture/pr42110.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cgraph.c
trunk/gcc/cgraph.h
trunk/gcc/cgraphunit.c
trunk/gcc/ipa.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-inline.c


-- 


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



[Bug middle-end/42110] [4.5 Regression] ICE with inlining

2009-12-08 Thread hubicka at gcc dot gnu dot org


--- Comment #11 from hubicka at gcc dot gnu dot org  2009-12-08 16:36 
---
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|NEW |ASSIGNED
   Last reconfirmed|2009-12-03 05:09:49 |2009-12-08 16:36:42
   date||


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



[Bug middle-end/42110] [4.5 Regression] ICE with inlining

2009-12-08 Thread hubicka at ucw dot cz


--- Comment #10 from hubicka at ucw dot cz  2009-12-08 16:35 ---
Subject: Re:  [4.5 Regression] ICE with inlining

> I assumed it is special vtable handling (that likely doesn't cause the
> addressable flag to be set?) - I simply stopped debugging at the point
> where I noticed the node gets removed even though there are still
> indirect calls that possibly can reach it.

The problem is uglier.  When we clone node and we inline it, we must
keep the clone around (since while inlining we can't apply the changes
needed by ipa-cp clonning or other passes in general). But since this
interfere with reachability as toon noticed, we put this node into
"limbo stage" (i.e. it is around, has no call edges).  When we decide to
materialize it, we add the edges as previously indirect creating the
extra call that should not exist.

I've fixed it by simply removing those edges once clonning is finished.

Honza


-- 


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



[Bug middle-end/42110] [4.5 Regression] ICE with inlining

2009-12-08 Thread rguenth at gcc dot gnu dot org


--- Comment #9 from rguenth at gcc dot gnu dot org  2009-12-08 16:01 ---
I assumed it is special vtable handling (that likely doesn't cause the
addressable flag to be set?) - I simply stopped debugging at the point
where I noticed the node gets removed even though there are still
indirect calls that possibly can reach it.


-- 


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



[Bug middle-end/42110] [4.5 Regression] ICE with inlining

2009-12-08 Thread hubicka at gcc dot gnu dot org


--- Comment #8 from hubicka at gcc dot gnu dot org  2009-12-08 15:57 ---
So we have new direct call appearing to function that has been previously
eliminated as unreachable (after inlining) as a result of devirtualization? 
In general if function have address taken, we should not remove it since it is
needed, or is that the special vtable handling?


-- 


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



[Bug middle-end/42110] [4.5 Regression] ICE with inlining

2009-12-04 Thread hjl dot tools at gmail dot com


--- Comment #7 from hjl dot tools at gmail dot com  2009-12-04 13:45 ---
It is caused by revision 154200:

http://gcc.gnu.org/ml/gcc-cvs/2009-11/msg00421.html


-- 


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



[Bug middle-end/42110] [4.5 Regression] ICE with inlining

2009-12-04 Thread rguenth at gcc dot gnu dot org


--- 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)
1696cgraph_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< >::fooB(char) [with int  = 0]/5
(1.00 per call) (can throw external) void B< >::fooB(char) [with int
 = 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< >::fooB(char) [with int  = 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



[Bug middle-end/42110] [4.5 Regression] ICE with inlining

2009-12-04 Thread rguenth at gcc dot gnu dot org


--- Comment #5 from rguenth at gcc dot gnu dot org  2009-12-04 12:06 ---
The ICE goes away with -fno-ipa-cp.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||jamborm at gcc dot gnu dot
   ||org


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



[Bug middle-end/42110] [4.5 Regression] ICE with inlining

2009-12-04 Thread rguenth at gcc dot gnu dot org


--- Comment #4 from rguenth at gcc dot gnu dot org  2009-12-04 12:03 ---
This also happens when I try to reproduce the tramp3d profile mismatch
(well, if checking is enabled only obviously).


-- 


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



[Bug middle-end/42110] [4.5 Regression] ICE with inlining

2009-11-27 Thread rguenth at gcc dot gnu dot org


--- Comment #3 from rguenth at gcc dot gnu dot org  2009-11-27 11:35 ---
*** Bug 42187 has been marked as a duplicate of this bug. ***


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||dcb314 at hotmail dot com


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



[Bug middle-end/42110] [4.5 Regression] ICE with inlining

2009-11-27 Thread rguenth at gcc dot gnu dot org


--- Comment #2 from rguenth at gcc dot gnu dot org  2009-11-27 11:25 ---
Re-confirmed.  Might cause wrong-code, so P1 even if ice-checking.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

   Keywords||ice-checking
   Priority|P3  |P1
   Last reconfirmed|2009-11-20 10:58:05 |2009-11-27 11:25:19
   date||


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



[Bug middle-end/42110] [4.5 Regression] ICE with inlining

2009-11-20 Thread rguenth at gcc dot gnu dot org


--- Comment #1 from rguenth at gcc dot gnu dot org  2009-11-20 10:58 ---
Honza?


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu dot
   ||org
 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-11-20 10:58:05
   date||


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



[Bug middle-end/42110] [4.5 Regression] ICE with inlining

2009-11-19 Thread reichelt at gcc dot gnu dot org


-- 

reichelt at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|--- |4.5.0


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