Re: get_current is __pure__, maybe __const__ even

Albert Cahalan
2004-09-16T14:18:31Z

On Thu, 2004-09-16 at 02:58, Andi Kleen wrote:
> Albert Cahalan <albert@users.sf.net> writes:
>
> > Andi Kleen writes:
> >
> >> Please CSE "current" manually. It generates
> >> much better code on some architectures
> >> because the compiler cannot do it for you.
> >
> > This looks fixable.
>
> I tried it some years ago, but I ran into problems with the scheduler
> and some other code and dropped it.

Right now, I'm thinking the switch_to assembly
has bad asm constraints.

I count 8 items passed in or out of the asm.
I count 11 clobbers. You don't have 19 registers.

If you pass something in and then destroy it,
you're supposed to use a dummy output. Look at
the i386 version, where esi and edi are dummy
outputs for this reason.

I recall seeing i386 compilers complain about
clobbered inputs. I guess the x86-64 gcc needs
to have this warning added?