public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: Fabian Cenedese <Cenedese@indel.ch>
Cc: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Re: Variable order and location within the section - optimization level dependent
Date: Mon, 21 Oct 2013 15:12:00 -0000	[thread overview]
Message-ID: <CAKOQZ8ysnbhopefKHn0pjdAMGnBNxEbKDeHB0YykjwSH=ikMxA@mail.gmail.com> (raw)
In-Reply-To: <5.2.0.9.1.20131021113552.0631a6f8@localhost>

On Mon, Oct 21, 2013 at 2:46 AM, Fabian Cenedese <Cenedese@indel.ch> wrote:
>
> 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?

Well, OK.  I just committed a patch to add "when possible," so the
sentence now reads "For new code, it is better to use attributes when
possible."


> 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 :)

I don't know how to enumerate the cases because I don't know what
people use -fno-toplevel-reorder for.

I continue to believe that it is always possible to rework your code
using attributes.  For the OP's case a struct plus #define macros
would have addressed the case, until the code was very unusual.

Ian

      reply	other threads:[~2013-10-21 15:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-16 11:25 Janáček Jiří
2013-10-16 13:55 ` Ian Lance Taylor
2013-10-16 14:06   ` Janáček Jiří
2013-10-16 14:30     ` Ian Lance Taylor
2013-10-17  7:46       ` Janáček Jiří
2013-10-17 16:02         ` Ian Lance Taylor
     [not found]       ` <CAKOQZ8xcYOortK4XfwKLcom9hGzx_33if+TKQMnuRW-RHiXVDQ@mail.g mail.com>
2013-10-21  9:47         ` Fabian Cenedese
2013-10-21 15:12           ` Ian Lance Taylor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKOQZ8ysnbhopefKHn0pjdAMGnBNxEbKDeHB0YykjwSH=ikMxA@mail.gmail.com' \
    --to=iant@google.com \
    --cc=Cenedese@indel.ch \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).