gcc optimize option

Discussion in 'C Programming' started by zhangyue.zl@gmail.com, Apr 20, 2006.

  1. Guest

    For a source file ,which optimize option can make gcc generate a
    smaller object file,O2 or O3?
    Thanks!
    , Apr 20, 2006
    #1
    1. Advertising

  2. 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
    Robert Gamble, Apr 20, 2006
    #2
    1. Advertising

  3. Michael Mair Guest

    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.
    Michael Mair, Apr 20, 2006
    #3
  4. "" <> 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) <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.
    Keith Thompson, Apr 20, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Julien ROUZIERES

    g++ -pg option and -shared option

    Julien ROUZIERES, Dec 21, 2004, in forum: C++
    Replies:
    1
    Views:
    714
    GianGuz
    Dec 21, 2004
  2. Cas
    Replies:
    5
    Views:
    790
    Kevin Jones
    Aug 28, 2006
  3. Kevin Blount

    page.aspx?option - how to detect "option"

    Kevin Blount, Nov 28, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    604
    =?Utf-8?B?RWVyYWo=?=
    Nov 28, 2006
  4. Elmar
    Replies:
    14
    Views:
    1,020
    Tim Rentsch
    Mar 25, 2010
  5. John

    Regex for <option> ... </option>

    John, Jan 23, 2009, in forum: Perl Misc
    Replies:
    10
    Views:
    236
    Eric Pozharski
    Jan 29, 2009
Loading...

Share This Page