Bug 48110 - __attribute__ ((optimize(...))) version of -Ofast
Summary: __attribute__ ((optimize(...))) version of -Ofast
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on: 53776
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-14 10:30 UTC by vincenzo Innocente
Modified: 2013-11-08 10:34 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vincenzo Innocente 2011-03-14 10:30:03 UTC
gcc 4.6 introduces a new global optimization switch -Ofast.
Independently of what actually it is composed of, it seems not supported by  __attribute__ ((optimize(...))) 

for instance
__attribute__ ((optimize("fast-math"))) works
 __attribute__ ((optimize("3"))) works

while
 __attribute__ ((optimize("fast")))
produces 
 error: unrecognized command line option '-ffast'


is this a bug or shall I use a different syntax?
Comment 1 Mingjie Xing 2013-11-08 03:06:15 UTC
The document says, "Numbers are assumed to be an optimization level. Strings that begin with O are assumed to be an optimization option, while other options are assumed to be used with a -f prefix."

So, it should be __attribute__ ((optimize("Ofast"))).
Comment 2 Richard Biener 2013-11-08 10:34:15 UTC
Indeed, not sure why we even support "3" or "s", but "fast" would certainly
alias with -fast ;)