This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Newbie question on -Os
- To: "Stephano Mariani" <sk dot gccml at btinternet dot com>
- Subject: Re: Newbie question on -Os
- From: Paolo Carlini <pcarlini at unitus dot it>
- Date: Thu, 1 Nov 2001 12:01:50 +0100
- Cc: gcc at gcc dot gnu dot org
- References: <003401c1638c$0876a8d0$0100a8c0@sknet01>
On Friday 02 November 2001 11:49, you wrote:
> Hi!
>
> I'm relatively new to gcc, since I have only used it for 2-3 weeks.
> I build GCC-3.0.2 on cygwin (under windows 2000) and my linux box (redhat
> 7.0).
> My problem is that I have used many many compilers, and find gcc far
> superior to most of them, but it seems that the files produced by gcc tend
> to be huge as compared with those produced by the likes of MSVC6 and
> Borland CC (even after strip and upx). I assume theres a set of
> commandline-options for optimising for size but the only ones I found help
> are -Os
> and -fomit-frame-pointer.
>
> Please advise as to the best options for size reductions.
As repeatedly suggested in these lists, try adding
-mpreferred-stack-boundary=2 to -Os: often it helps!
Cheers,
Paolo.