RE: [PATCH] fixes for building kernel 2.5.45 using Intel compiler

Linus Torvalds (torvalds@transmeta.com)
Thu, 31 Oct 2002 11:04:43 -0800 (PST)


On 31 Oct 2002, Alan Cox wrote:
>
> The compiler at function entry cannot know anything about the scope of
> objects above the return address. It could equally be a valid pointer to
> data above the stack with a global context created by a thread library.
>
> I'm curious if the optimisation is actually legal

The optimization is not legal or illegal per se, the only thing that can
make it legal or illegal is a defined calling convention. The calling
convention can say who the "owner" of the arguments is: the caller or the
callee.

The kernel doesn't have a well-enough-defined calling convention to be
able to make a good judgement. We tend to use the same calling convention
as the native compiler in user space does, but even that's not always true
(ie it can be modified by things like -mregparm etc, on a per-architecture
basis).

I don't think the original iBCS2 calling convention (that Linux uses on
x86) is specific on this issue. That would be the thing that would decide
the legality of the optimization, I think.

Considering that Intel largely wrote iBCS2, I guess some Intel person can
know what the standard was ;)

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/