[PATCH] switch ARM modes in inline asm

Renato Golin renato.golin at linaro.org
Mon Dec 2 04:51:37 PST 2013


On 2 December 2013 07:32, Jim Grosbach <grosbach at apple.com> wrote:
> Personally, I don’t think this is the kind of thing that’s appropriate to do in inline assembler at all, partly for the reasons you outline above.

I think we all agree on that. ;)


> Pragmatically, that leaves us with two realistic options. 1) Fix the assembler mode directives to work in inline assembly and if the user abuses them and doesn’t switch back or something, they get a really nasty bug. 2) Prohibit them in inline assembly and issue a diagnostic if we see them.
>
> I’m fine with either, but prefer (2) in a vacuum. If there’s significant extant use cases where people are doing this, then that may not be tractable.

I believe there's only one or two cases where people accidentally
forget to switch back (which is a user bug and needs an error) or the
default mode is unspecified and the compiler gets confused (which is a
compiler bug and needs fixing). Greg, do you have bugs open for each
of these cases?

I wouldn't try to support explicit mode switch in inline asm unless
there is a very specific use case (kernel stuff) where this is
paramount. Even then, I'd fix the bugs outlined above first, and let
that for later, enabled via a special switch or something.

cheers,
--renato




More information about the llvm-commits mailing list