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: [PATCH] PR optimization/12324


> Jan Hubicka wrote:
> >>On Sat, 27 Sep 2003, Jan Hubicka wrote:
> >>
> >>>the problem is that we deffer compound literals until after finalizing
> >>>compilation unit (like we currently do for declarations without 
> >>>initializer).
> >>>I don't see any reason for doing so.  Would be this OK?
> >>
> >>The point is that when the extension (gnu89 mode only, used by Linux
> >>kernel) where compound literals can be used as static initializers (as if
> >>they were the brace-enclosed list rather than an anonymous variable) is
> >>used, the compound literal shouldn't itself be emitted - only the
> >>initialized variable.  Does this patch preserve that property?
> >
> >I am not quite sure I follow this.  Can you show me some testcase?
> >In non-unit-at-a-time the compound literal will be output always I guess
> >after my patch, while in unit-at-a-time only when it is actually used.
> >Perhaps we can add if (!flag_unit_at_a_time) around that line instead.
> 
> I've submitted this PR. The attached test case is a simplified case of
> a real case from linux/drivers/net/fec.c:

I do understand the problem you have.  What I don't follow however is
why the function needs to be deferred.  It seems to me that it will be
output anyway as long as it is referenced but I may be wrong (this is
all bit nasty), so I would like to understand it better.
I see we got suck here somewhat,
I will try to search for archives first on why that line got in at first
place.

Honza


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