This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: #pragma optimization_level
- From: Georg Bauhaus <bauhaus at uni-duisburg dot de>
- To: Robert Dewar <dewar at adacore dot com>
- Cc: Dale Johannesen <dalej at apple dot com>, gcc List <gcc at gcc dot gnu dot org>
- Date: Mon, 04 Apr 2005 02:03:58 +0200
- Subject: Re: RFC: #pragma optimization_level
- Organization: Home
- References: <c2be513156e77e58189807976b82956f@apple.com> <425045DF.9020003@adacore.com>
Robert Dewar wrote:
A little note is that Ada has a pragma Opimize that would make
use of this feature (it's currently pretty much ignored).
Though what GCC does for a compilation unit with Ada's pragma
Optimize(Off); inside it is close to what some users seem to be wanting
in C.
GCC does complain about an attempt to translate the program below
with optimization turned on:
$ gcc -gnatv -c -O2 opt.adb
...
2. pragma optimize(Off);
|
>>> warning: must specify -O0
procedure Opt is
pragma Optimize(Off);
begin
for k in 1 .. 1_000_000 loop
null;
end loop;
end Opt;