This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Suboptimal code on x86
- To: Remi Guyomarch <rguyom at mail dot dotcom dot fr>
- Subject: Re: Suboptimal code on x86
- From: Martin Kahlert <martin dot kahlert at mchp dot siemens dot de>
- Date: Tue, 7 Jul 1998 09:08:36 +0200
- Cc: egcs at cygnus dot com
- References: <35A1264F.51801436@mail.dotcom.fr>
- Reply-To: martin dot kahlert at mchp dot siemens dot de
Quoting Remi Guyomarch (rguyom@mail.dotcom.fr):
> This is with snapshot 19980530 :
>
> void foo (int) __attribute__ ((__regparm__(1)));
>
> void foo (int bar) {
> int baz = bar*2;
> printf ("%d %d", bar, baz);
> }
>
> with -O9 -fomit-frame-pointer give me this code :
>
> foo:
> movl %eax,%edx ##
> movl %edx,%eax ## huh ?
> addl %edx,%eax
> pushl %eax
> pushl %edx
> pushl $.LC0
> call printf
> addl $12,%esp
> ret
With this newer one (gcc -v):
Reading specs from /sw/egcs/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.42/specs
gcc version egcs-2.91.42 19980621 (gcc2 ss-980502 experimental)
I get:
foo:
movl %eax,%edx
addl %eax,%edx
pushl %edx
pushl %eax
pushl $.LC0
call printf
addl $12,%esp
ret
So it seems to be corrected, yet.
Martin.
--
What is the difference between Jurassic Park and Microsoft?
One is an over-rated high tech theme park based on prehistoric
information and populated mostly by dinosaurs,
the other is a Steven Spielberg movie.