Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > gcc optimize option

Reply
Thread Tools

gcc optimize option

 
 
zhangyue.zl@gmail.com
Guest
Posts: n/a
 
      04-20-2006
For a source file ,which optimize option can make gcc generate a
smaller object file,O2 or O3?
Thanks!

 
Reply With Quote
 
 
 
 
Robert Gamble
Guest
Posts: n/a
 
      04-20-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) 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

 
Reply With Quote
 
 
 
 
Michael Mair
Guest
Posts: n/a
 
      04-20-2006
(E-Mail Removed) 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.
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      04-20-2006
"(E-Mail Removed)" <(E-Mail Removed)> 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) (E-Mail Removed) <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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does GCC optimize variadic functions to death? Elmar C Programming 14 03-25-2010 12:03 AM
GCC 3.4.3 and GCC 4.1.2 ashnin C++ 1 07-07-2008 01:10 PM
Template construction in old gcc 3.3.3 does not compile in gcc 3.4.4 eknecronzontas@yahoo.com C++ 5 09-17-2005 12:27 AM
gcc 2.95 and gcc 3.2 gouqizi.lvcha@gmail.com C++ 8 03-16-2005 02:34 AM
C99 structure initialization in gcc-2.95.3 vs gcc-3.3.1 Kevin P. Fleming C Programming 2 11-06-2003 05:15 AM



Advertisments