On Sat, 2005-08-20 at 00:44 +0200, Laurent GUERBY wrote: > On Sat, 2005-08-20 at 00:36 +0200, Laurent GUERBY wrote: > > A patch by Andrew Pinski is there: > > > > http://gcc.gnu.org/ml/gcc-patches/2005-07/msg01666.html > > > > But review was negative, so it was not commited. > > > > Hope this helps, > > > > Laurent > > > > PS: is there a PR for this one? > > Thanks to Andrew Pinski for the tip: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22533
I actually believe Richard may have come up with the wrong idea (using the analyze_expr hook) because Andrew didn't fully explain what is going on. What happens is that the IPA passes, not cgraph, want to analyze variables, including statics. If it was just cgraph, i would agree that modifying analyze_expr, is probably the right solution. But for general IPA working on the cgraph + GIMPLE level, as is what is happening here, I think we really need to do something about static variable initializers so they are in GIMPLE. Richard, I assume you'd rather have us hack around this for stage3 somehow, and come up with a way to gimplify the static var constructors for 4.2? (i guess that means creating a new init function and shoving them in there, and marking it special somehow) Or do you have another idea? This is not a case we can just ignore the constructors, they contain addressof operations we need to be able to see to come up with the right answers for type escape analysis, static variable address taken, etc :( --Dan