naumcho
naumcho

Reputation: 19891

gcc -O4 optimization flag

What's the meaning of the -O4 optimization flag in gcc (3.2.3)? What's the difference to O3? When would you use one vs. the other?

The man pages only mention O, O0-3, Os, no word of the mysterious O4.

Upvotes: 16

Views: 17646

Answers (2)

Lukasz Stelmach
Lukasz Stelmach

Reputation: 5381

You can check what optimization are enabled for each level

gcc -c -Q -O3 --help=optimizers | grep enabled

It works at least for gcc 4.4.

Upvotes: 22

tstenner
tstenner

Reputation: 10291

There is no -O4 in 3.2.3. Everything above -O3 results in -O3 being chosen.

Upvotes: 26

Related Questions