This is the mail archive of the gcc-help@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: Variable order and location within the section - optimization level dependent


At 09:02 17.10.2013 -0700, Ian Lance Taylor wrote:
>On Thu, Oct 17, 2013 at 12:46 AM, JanáÄ?ek JiÅ?í <jiri.janacek@skoda.cz> wrote:
>>
>> Right, the obvious solution is to apply a struct - originally I intended to avoid this way (there are some internal reasons for that).
>> IMHO the description of the "-fno-toplevel-reorder" flag (http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#Optimize-Options) is a bit confusing - I mean especially this section: "For new code, it is better to use attributes.â??
>
>I understand that you found it confusing.  But I have to say, even on
>re-reading and re-thinking, I think the statement is correct.  For new
>code, it is better to use attributes.  I don't think that says or
>implies that there is an attribute that means the same thing as
>-fno-toplevel-reorder.

I'll have to side with the OP here. We also use code that relies on the order
of the toplevel items so we need to use the no-reorder flag, no problem there.
So I was eagerly reading this thread to find other ways to achieve the same
result (there don't seem to be, that's okay).

However reading the documentation I find it hard to see any other meaning
than that "there are attributes that do the same as -fno-toplevel-reorder". If
there aren't any attributes for this precise case then what's this sentence
doing in the -fno-toplevel-reorder section?

>You've decided to follow a path that GCC does not support with
>attributes.  That is your choice.  There are other approaches you
>could use, that GCC does support directly, and for some reason they
>won't work for you.  But fortunately there is a choice that works for
>you: the -fno-toplevel-reorder option.  So it seems that all is well.

I think these approaches where one could use attributes to influence
the ordering should be mentioned here and also where it's not possible.
Otherwise people might start looking for these attributes that don't
exist (at least 2 people now :)

Besides the nitpicking: Thanks for a great product and the help on
this list (or elsewhere)

bye  Fabi


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