This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Optimization bug on i386, stack fiddling


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]