[cfe-dev] A new builtin: __builtin_stack_pointer()

Renato Golin renato.golin at linaro.org
Mon Nov 11 02:49:54 PST 2013


On 11 November 2013 09:46, PaX Team <pageexec at gmail.com> wrote:

> now all this is very linux (and kernel context) specific so i don't know if
> you really need to worry about other use cases. of course there's the more
> generic gcc feature of being able to assign other registers to variables,
> not just the stack pointer. i don't know if clang/llvm wants to go there
> as it then brings up the whole -ffixed-REG/-fcall-saved-REG/-fcall-used-REG
> business as well ;).
>

We already have -ffixed-r9 for ARM for similar reasons, but I think we
would require an extensive discussion (like this one) to define if we want
to have those options, lots of built-in intrinsics, or both. But, as you
said, one thing at a time... ;)

I think there are clear reasons for Clang/LLVM to support the kernel, the
issue is just finding the best solution for each problem. Because the
kernel and GCC walked so closely for decades, some of the solutions weren't
taken because it was the best, but because it was the simplest. If we do
the same now, we'll never get rid of bad code on both kernels and compilers.

The GCC folks are also taking a similar approach nowadays, and would be
good to know what they think on the problems we're solving here.

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131111/c4d77af2/attachment.html>


More information about the cfe-dev mailing list