This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] hot/cold attributes on labels
- From: Andi Kleen <andi at firstfloor dot org>
- To: Richard Henderson <rth at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Baron <jbaron at redhat dot com>, David Daney <ddaney at caviumnetworks dot com>
- Date: Wed, 20 Oct 2010 23:23:32 +0200
- Subject: Re: [RFC] hot/cold attributes on labels
- References: <20101019214337.GD2855@redhat.com> <4CBF5AAF.6050103@redhat.com>
Richard Henderson <rth@redhat.com> writes:
> The motivation for this feature is to inform the compiler how
> it may wish to layout blocks following an asm goto.
>
> Since we can't annotate the asm goto with __builtin_expect,
> putting some information onto the label decl itself seems a
> reasonable solution.
>
> Note that one needs to use -O2 and not -Os in order to see the
> effects of this patch, since bb-reorder does nothing when
> optimizing for size -- despite any explicit option enabling block
> reordering. This is probably a bug. Of course, a size-sensitive
> block reordering pass would be Even Cooler.
>
> Comments?
I would be a bit worried about what this syntax does for syntax error
recovery, because now you can have parts of a type in
the middle of a expression. Without a parser generator
double checking this it's hard to know.
It would be bad to do the same mistakes as Stroustrup did
long ago for C too :-)
It would be probably better to put some more unique syntax markers
around the attribute (maybe [] ? )
And maybe double check the result is still LL(1).
-Andi
--
ak@linux.intel.com -- Speaking for myself only.