This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR optimization/12324
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Bernardo Innocenti <bernie at develer dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>,"Joseph S. Myers" <jsm at polyomino dot org dot uk>, Jan Hubicka <jh at suse dot cz>,gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Fri, 3 Oct 2003 21:09:35 +0200
- Subject: Re: [PATCH] PR optimization/12324
- References: <20030927135507.GG23075@kam.mff.cuni.cz> <Pine.LNX.4.58.0309271654050.21283@kern.srcf.societies.cam.ac.uk> <20030927183054.GA25269@atrey.karlin.mff.cuni.cz> <3F7D2FEC.5040200@develer.com>
> 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