This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Variable order and location within the section - optimization level dependent
- From: Ian Lance Taylor <iant at google dot com>
- To: Janáček Jiří <jiri dot janacek at skoda dot cz>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 17 Oct 2013 09:02:19 -0700
- Subject: Re: Variable order and location within the section - optimization level dependent
- Authentication-results: sourceware.org; auth=none
- References: <65513286F68AA34992CFC96B7C77DF397697A7FF at srv-exch-mbx2 dot skoda dot cz> <CAKOQZ8wh4sJGYxRVGtYiHCfsHxi6Jgqf7EATNtzVTjw+DfcLZg at mail dot gmail dot com> <65513286F68AA34992CFC96B7C77DF397697A867 at srv-exch-mbx2 dot skoda dot cz> <CAKOQZ8wXbrujV5ciG059SYe9eEMTS2s_fs151nWd_9Q2dpgasw at mail dot gmail dot com> <65513286F68AA34992CFC96B7C77DF397697A92D at srv-exch-mbx2 dot skoda dot cz>
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.
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.
Ian