Re: get_current is __pure__, maybe __const__ even

From: William Lee Irwin III
Date: Wed Sep 15 2004 - 18:45:42 EST


Andi Kleen writes:
>> Please CSE "current" manually. It generates
>> much better code on some architectures
>> because the compiler cannot do it for you.

On Wed, Sep 15, 2004 at 06:50:00PM -0400, Albert Cahalan wrote:
> This looks fixable.
> At the very least, __attribute__((__pure__))
> will apply to your get_current function.
> I think __attribute__((__const__)) will too,
> even though it's technically against the
> documentation. While you do indeed read from
> memory, you don't read from memory that could
> be seen as changing. Nothing done during the
> lifetime of a task will change "current" as
> viewed from within that task.

The fix needs to be made to gcc, not the kernel.


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