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: [RFC] hot/cold attributes on labels


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.


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