This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Bizarrely Poor Code from Bizarre Machine-Generated C Sources
- From: Andrew Haley <aph-gcc at littlepinkcloud dot COM>
- To: "Barak A. Pearlmutter" <barak at cs dot nuim dot ie>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 29 May 2007 17:09:21 +0100
- Subject: Re: Bizarrely Poor Code from Bizarre Machine-Generated C Sources
- References: <E1Ht4DN-000179-4e@localhost>
Barak A. Pearlmutter writes:
> Success!
>
> Some working magic seems to be this:
>
> gcc -s -o particle1 \
> -O3 \
> -march=k8 \
> -mfpmath=sse \
> -finline-limit=100000 \
> --param large-function-insns=1000000 \
> --param inline-unit-growth=1000000 \
> --param sra-field-structure-ratio=0 \
> particle1.c -lm
>
> although it looks like -Os gives an additional improvement.
>
> This (with GCC 4.1) reduces code volume to about 16k from a previous
> near 1M, and reduces runtime by a factor of about 2700, as compared to
> just -O3.
>
> Further improvements welcome.
>
> I'd also suggest adding a section to the GCC documentation on "how to
> use GCC as a back-end to another compiler" which gives some typical
> magic options like the above that would be useful in circumstances
> like these.
http://gcc.gnu.org/wiki
Enjoy...
Andrew.