Re: 2.4 kernel & gcc code generation: a bug?

H. Peter Anvin (hpa@zytor.com)
6 Feb 2001 23:46:28 -0800


Followup to: <3A8108F8.2476.21D0F5@localhost>
By author: "Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de>
In newsgroup: linux.dev.kernel
>
> You'll notice that %edx is not pushed at the start of the function.
> Unless the caller saves that, edx will be spilled. Depending on the
> level of optimization this can be bad. Am I wrong?
>

Yes. %eax, %edx and %ecx are defined as caller-saved registers. Each
function is free to clobber them at will.

Now, if you saw the same for %ebx, %ebp, %esi or %edi, that would be
bad.

-hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/