This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Unit-at-a-time in real world (Re: Development plan *ducks*)
- From: "Zack Weinberg" <zack at codesourcery dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>, Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>, David Edelsohn <dje at watson dot ibm dot com>, Diego Novillo <dnovillo at redhat dot com>, gcc mailing list <gcc at gcc dot gnu dot org>, Richard Henderson <rth at redhat dot com>, Jason Merrill <jason at redhat dot com>, pop at gauvain dot u-strasbg dot fr, Daniel Berlin <dberlin at dberlin dot org>, aj at suse dot de
- Date: Tue, 29 Jul 2003 11:01:36 -0700
- Subject: Re: Unit-at-a-time in real world (Re: Development plan *ducks*)
- References: <20030728191927.GA26264@atrey.karlin.mff.cuni.cz><200307281936.PAA30478@makai.watson.ibm.com><20030728204001.GA31710@atrey.karlin.mff.cuni.cz><1059429748.3649.77.camel@steven.lr-s.tudelft.nl><8765lm7178.fsf@egil.codesourcery.com><1059434004.3647.156.camel@steven.lr-s.tudelft.nl><20030728233200.GH27638@kam.mff.cuni.cz><1059472209.3651.64.camel@steven.lr-s.tudelft.nl><20030729174033.GH2231@kam.mff.cuni.cz>
Jan Hubicka <jh@suse.cz> writes:
>
> a) program referencing variables
> from asm staements and not using __attribute__ ((used)).
> Such problems we hit in glibc, prelink, wine and kernel.
> One of anoying side effect is that the proper combination of flags for
> such variable is __attribute__ ((used)) to instruct compiler to always
> emit the variable *together* with __attribute__ ((unused)) that instruct
> compiler to not emit warning. This looks funny, so I would guess that
> attribute used sould imply __attribute__ ((unused)) and set TREE_USED
> flag too. (do you follow the funny logic in the names)?
I think you're right, __attribute__ ((used)) should silence the
warning. Send in a patch.
> Another ugly thing is that 3.2 does not support attribute used on
> variables so you need ifdef machinery.
Can the problem be avoided in another way, e.g. by putting the
variable into the operands list of the asm statement?
> b) using toplevel asm statements to change sections of functions (this
> is present in gcc runtime and glibc). The proper fix is to use gcc
> section attributes or -fno-unit-at-a-time as work around.
The C++ front end, down the road, would be happier if -funit-at-a-time
were the *only* option. So could you please do what it takes to make
sure there is another way to handle all such cases? (Pathological
examples can be pushed off with 'rewrite in assembly'.)
zw