This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Optimization bug on i386, stack fiddling
- To: Bernd Schmidt <bernds at balti dot cygnus dot co dot uk>
- Subject: Re: Optimization bug on i386, stack fiddling
- From: Lars Balker Rasmussen <lbr at mjolner dot dk>
- Date: 06 Jan 2000 17:56:28 +0100
- Cc: gcc-bugs at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10001061606230.21245-100000@balti.cygnus.co.uk>
Bernd Schmidt <bernds@balti.cygnus.co.uk> writes:
> Try
> asm ("all the pushes
> call foo
> all the pops");
>
> or, even better, leave the saving of registers to the compiler:
>
> asm ("call foo" : : : "eax", "ebx", "ecx", ...);
foo() really takes two arguments (foo(p, t)), so I tried the following
asm ("addl $-8, %%esp\n\t"
"pushl %1\n\t"
"pushl %0\n\t"
"call foo\n\t"
"addl $8, %%esp"
:
: "r" (p), "r" (t)
: "ebx", "ecx", "esi", "edi");
gcc wouldn't let me put "eax" and "edx" in the list, and it doesn't
generate code to save ecx. I don't know if this is a problem yet;
foo() is really rather nasty.
However, it works for my single test-case, so I'll try to give it the
entire regression test suite tour tomorrow.
Thanks!
--
Lars Balker Rasmussen, Software Engineer, Mjolner Informatics ApS
lbr@mjolner.dk