* Suboptimal code on x86
@ 1998-07-06 14:48 Remi Guyomarch
1998-07-07 5:29 ` Martin Kahlert
0 siblings, 1 reply; 2+ messages in thread
From: Remi Guyomarch @ 1998-07-06 14:48 UTC (permalink / raw)
To: egcs list
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 563 bytes --]
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
--
Rémi Don't waste your computer's time. Distribute it!
http://www.distributed.net/
RC5 cores source code : http://altern.com/rguyom/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Suboptimal code on x86
1998-07-06 14:48 Suboptimal code on x86 Remi Guyomarch
@ 1998-07-07 5:29 ` Martin Kahlert
0 siblings, 0 replies; 2+ messages in thread
From: Martin Kahlert @ 1998-07-07 5:29 UTC (permalink / raw)
To: Remi Guyomarch; +Cc: egcs
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1998-07-07 5:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-07-06 14:48 Suboptimal code on x86 Remi Guyomarch
1998-07-07 5:29 ` Martin Kahlert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).