What does the -O2 option for gcc do? [closed]

Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
What does the -O2 option for gcc do?
eg. gcc -O2 file1.c -o file1.o
gcc c
closed as off-topic by slm⦠Jun 28 at 2:50
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." â slm
add a comment |Â
up vote
-1
down vote
favorite
What does the -O2 option for gcc do?
eg. gcc -O2 file1.c -o file1.o
gcc c
closed as off-topic by slm⦠Jun 28 at 2:50
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." â slm
There's a detailed page at gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html, or rungcc -c -Q -O2 --help=optimizers
â Nick ODell
Jun 28 at 2:18
add a comment |Â
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
What does the -O2 option for gcc do?
eg. gcc -O2 file1.c -o file1.o
gcc c
What does the -O2 option for gcc do?
eg. gcc -O2 file1.c -o file1.o
gcc c
asked Jun 28 at 2:12
CJ7
2171513
2171513
closed as off-topic by slm⦠Jun 28 at 2:50
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." â slm
closed as off-topic by slm⦠Jun 28 at 2:50
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." â slm
There's a detailed page at gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html, or rungcc -c -Q -O2 --help=optimizers
â Nick ODell
Jun 28 at 2:18
add a comment |Â
There's a detailed page at gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html, or rungcc -c -Q -O2 --help=optimizers
â Nick ODell
Jun 28 at 2:18
There's a detailed page at gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html, or run
gcc -c -Q -O2 --help=optimizersâ Nick ODell
Jun 28 at 2:18
There's a detailed page at gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html, or run
gcc -c -Q -O2 --help=optimizersâ Nick ODell
Jun 28 at 2:18
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
The -O options turn on compiler optimization. From man gcc:
-O2 Optimize even more. GCC performs nearly all supported
optimizations that do not involve a space-speed tradeoff. As
compared to -O, this option increases both compilation time and the
performance of the generated code.
For a list of the specific optimizations, refer to the manual pages.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
The -O options turn on compiler optimization. From man gcc:
-O2 Optimize even more. GCC performs nearly all supported
optimizations that do not involve a space-speed tradeoff. As
compared to -O, this option increases both compilation time and the
performance of the generated code.
For a list of the specific optimizations, refer to the manual pages.
add a comment |Â
up vote
0
down vote
accepted
The -O options turn on compiler optimization. From man gcc:
-O2 Optimize even more. GCC performs nearly all supported
optimizations that do not involve a space-speed tradeoff. As
compared to -O, this option increases both compilation time and the
performance of the generated code.
For a list of the specific optimizations, refer to the manual pages.
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
The -O options turn on compiler optimization. From man gcc:
-O2 Optimize even more. GCC performs nearly all supported
optimizations that do not involve a space-speed tradeoff. As
compared to -O, this option increases both compilation time and the
performance of the generated code.
For a list of the specific optimizations, refer to the manual pages.
The -O options turn on compiler optimization. From man gcc:
-O2 Optimize even more. GCC performs nearly all supported
optimizations that do not involve a space-speed tradeoff. As
compared to -O, this option increases both compilation time and the
performance of the generated code.
For a list of the specific optimizations, refer to the manual pages.
answered Jun 28 at 2:17
steeldriver
30.9k34877
30.9k34877
add a comment |Â
add a comment |Â
There's a detailed page at gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html, or run
gcc -c -Q -O2 --help=optimizersâ Nick ODell
Jun 28 at 2:18