PATCH: Fix 20000724-1.c

Linus Torvalds torvalds@transmeta.com
Tue May 1 14:09:00 GMT 2001


On Tue, 1 May 2001, Richard Henderson wrote:
>
> 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...

That would be useful even regardless of asm's: it would be wonderful to
have different calling conventions for certain functions (Linux already
uses this in the form of the "regparm()" attribute, of course).

And you _do_ actually have a limited form of that even for regular calls.
Doesn't marking a function "const" also mean that gcc knows that it won't
have side effects on memory?

So gcc must already have some limited support for this. Generalizing it
would help not just the asm case, but would proabbly be useful in general.

> > [ 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.

Oh, yes. And even with just one branch, multiple targets (ie allow a
computed branch from within asm).

> But at present the internals are too ugly to consider.

Oh, well..

		Linus



More information about the Gcc-patches mailing list