This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Target-specific pragmas
- To: Stan Shebs <shebs at apple dot com>
- Subject: Re: Target-specific pragmas
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: 20 Jun 2001 22:10:36 -0700
- CC: gcc at gcc dot gnu dot org
- References: <3B3149D1.8FB4E0B6@apple.com>
Stan Shebs <shebs@apple.com> writes:
> Undeterred by the embarassment of pascal strings :-), I'm sweeping on
> to Apple's steamy pile of target-specific pragmas. While it's actually
> quite pleasant to redo our old pragmas with the new cpplib machinery
> (thanks Zack!), some of the pragmas themselves are pretty dubious,
> and I'm hoping to find that nobody uses them. Anyway, the worthwhile
> ones raise a couple questions:
>
> 1. How should target-specific pragmas be documented? I notice that
> there are many existing pragmas in targets, but the manual does not
> seem to mention any of them anywhere. Is this deliberate?
Yes. I believe that nearly all of the target-specific pragmas are
only for backwards compatibility with other compilers, and that
the preferred interface is to use __attribute__.
> 2. Some of our pragmas exist to provide per-function control over
> optimization levels and flag_writable_strings. I vaguely remember
> some discussion over whether there ought to be some kind of fine
> grained control over flags via pragmas and/or attributes. Is there
> a consensus on what to do here?
The first, and trickiest part, is to work out what can actually be
changed, and when it can be changed. I'm pretty sure you can't switch
between -O1 and -O0 in one compilation, for instance; I'm not
convinced that flag_writable_strings can be changed reliably either.
Then, when this is known, the user interface details will be trivial
:-). Well, perhaps not, but until you know when things can be changed
there's no point trying to work out a user interface.
--
- Geoffrey Keating <geoffk@geoffk.org>