This is the mail archive of the gcc-patches@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]

Re: Random cleanups [2/4]: canonicalize ctor values


On 03/31/2011 03:22 AM, Michael Matz wrote:
this came up when looking into why the static ctors contain useless trees
(like casts).  We can simply canonicalize them while varpool analyzes
pending decls.  It'll look at initialzers once, where we can "gimplify"
them.  This requires making canonicalize_constructor_val be able to be
called outside of functions.  And it requires the java frontend not
leaving a dangling function decl as current (for the static ctor function
it generates).

canonicalize_constructor_val may be doing useful things on ADDR_EXPR too, but you don't call it in that case because you only added your code in the default case. You only reach it when the ADDR_EXPR is wrapped in a cast.


Any reason why you didn't add it (possibly wrapped in a loop) _before_ the switch statement?

Paolo


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