Optimization bug on i386, stack fiddling
Dima Volodin
dvv@egcs.dvv.ru
Thu Jan 6 09:18:00 GMT 2000
On 06 Jan 2000 17:56:28 +0100, Lars Balker Rasmussen wrote:
>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,
eax and edx are needed for the "r" constraints here, and they are not
supposed to preserve their value across function calls anyway.
> 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.
Most probably, ecx is not used in your function, and the compiler
doesn't need to save it.
>Lars Balker Rasmussen, Software Engineer, Mjolner Informatics ApS
Dima
More information about the Gcc-bugs
mailing list