By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,996 Members | 892 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,996 IT Pros & Developers. It's quick & easy.

gcc optimize option

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

Apr 20 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
zh*********@gmail.com wrote:
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

Apr 20 '06 #2

P: n/a
zh*********@gmail.com schrieb:
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
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Apr 20 '06 #3

P: n/a
"zh*********@gmail.com" <zh*********@gmail.com> writes:
For a source file ,which optimize option can make gcc generate a
smaller object file,O2 or O3?


For any arbitrary program, it probably depends.

For *your* program, try it and find out.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Apr 20 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.