gcc optimize option

Z

zhangyue.zl

For a source file ,which optimize option can make gcc generate a
smaller object file,O2 or O3?
Thanks!
 
R

Robert Gamble

For a source file ,which optimize option can make gcc generate a
smaller object file,O2 or O3?
Thanks!

This really isn't on topic here and the answer will depend on the
program being compiled but since gcc optimizes for speed with those
options and speed often comes at the expense of size, it is probably
safe to assume that 03 will generally produce faster, but larger
binaries. In gcc you can use the Os option to optimize for size which
is probably your best bet if that's what you are after.

Robert Gamble
 
M

Michael Mair

For a source file ,which optimize option can make gcc generate a
smaller object file,O2 or O3?

1) This is not topical in comp.lang.c
2) You multi-posted this request to other newsgroups -- if you
want to ask in several newsgroups or already have asked, make
this clear either by stating it or by cross-posting.
3) Have you ever considered reading the documentation?


Cheers
Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top