gcc 3.3.6 - stack corruption questions
Giovanni Bajo
rasky@develer.com
Mon Jul 25 22:28:00 GMT 2005
Louis LeBlanc <leblanc@keyslapper.net> wrote:
> I added the -fstack-check switch to my makefile and recompiled with
> various optimizations. I was pretty surprised at the file sizes that
> showed up:
>
> No Optimization:
> -rwxr-xr-x 1 leblanc daemon 1128660 Jul 25 16:25 myprocess*
>
> Optimized with -O2
> -rwxr-xr-x 1 leblanc daemon 1058228 Jul 25 17:36 myprocess*
>
> Optimized with -O3
> -rwxr-xr-x 1 leblanc daemon 1129792 Jul 25 17:32 myprocess*
>
> I would have expected much different results. Shouldn't the file
> sizes be smaller (at least a little) with the -O3 switch? Maybe
> there's a loop unrolled to make it faster, resulting in a larger
> codebase?
Or inlining, or many other things. If you care about size, use -Os.
--
Giovanni Bajo
More information about the Gcc
mailing list