This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Fix 20000724-1.c
On Tue, May 01, 2001 at 10:37:50AM -0700, Linus Torvalds wrote:
> I wonder what it is that a "call" instruction does differently
> from a "asm"?
The most relevant difference is that a call is known to use and
modify the fixed registers. Including the stack pointer.
> As far as I can tell, you could always make "asm" instructions work like
> function calls, except the clobbers are a bit different. Because from a
> conceptual point, that is exactly what they are: they are a "call" to
> assembly language with special calling convention. It wouldn't really use
> a "call" instruction - instead it would just insert the supplied assembly
> code.
>
> No?
You _really_ don't want that. It would absolutely kill optimization
for the trivial asm cases. We don't have the ability to represent
calls with arbirary call saved/clobbered conventions. Though such
a thing would be incredibly useful...
> [ Side note: If we'd really move asms towards more of a "control transfer"
> construct, then it would be absolutely _lovely_ to have support for a
> "conditional goto" asm too, not just a "function call asm". There are
> tons of cases where we'd love to do somehting like ...
Yeah, this has been brought up lots of times. Maybe -- just maybe --
after we revamp how switch statements are represented we can tackle
something like this. Cause you _know_ you're going to want to have
multiple branches in that asm statement.
But at present the internals are too ugly to consider.
r~