This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/20991] [4.0 Regression] ICE in cgraph_mark_reachable_node


------- Additional Comments From mark at codesourcery dot com  2005-04-17 17:04 -------
Subject: Re:  [4.0 Regression] ICE in cgraph_mark_reachable_node

jakub at gcc dot gnu dot org wrote:
> ------- Additional Comments From jakub at gcc dot gnu dot org  2005-04-17 16:08 -------
> Just got another bugreport for this bug, this time in gnomesword,
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=155152
> 
> The new references are created in tree-ssa-ccp.c's fold_stmt when it
> constant propagates the vptr access, but that is already when
> cgraph does not allow new references to be created.

The easiest solution, then, might be not to do the constant propagation 
in that case.  That seems like it would attack the problem directly and 
locally.  It would of course result in inferior code, but this is a case 
that C++ compilers have traditionally been lame about, so it's not 
really a step backwards.

It also sounds like you might be able to come up with a C test case. 
The basic flaw is that cgraph is not expecting an apparently 
unreferenced function to become referenced as a result of the optimizers 
figuring out to what function a pointer pointers.  That's a bug in 
cgraph; it should conservatively assume that all functions whose address 
has been taken are referenced.  It doesn't have to emit them, or even 
process them until it knows they are referenced, but it shouldn't assume 
that they're not needed until all points-to analysis is complete. 
Perhaps it needs a tri-state (referenced, not referenced, don't know).



-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]