ARM inline assembly usage in Linux kernel

Renato Golin
Thu Feb 20 10:21:00 GMT 2014

On 20 February 2014 10:11, Ramana Radhakrishnan
<> wrote:
> The current behaviour is that when the compiler generates code for
> Thumb1 and Thumb2 we switch back to the appropriate state after inline
> assembler is emitted. We don't switch back to ARM state on the (fairly
> robust) assumption that most inline assembler is written in ARM state.

We went one step further (possibly unnecessarily) and we check what's
the current state before going into inline asm and always emit the
correct code directive afterwards.

We're changing it back from the bad decision to validate inline
assembly (my fault!) in -S mode.

> In any case when users are switching ARM and Thumb states, they need
> to be careful anyway to make sure that the *machine* is going to get
> back to the *correct* state and having a screen full of possibly
> meaningless compile time errors may not be the most productive.

Maybe it'd be better to have fixed the error reporting in the first place. ;)

> .arm / .thumb directives should not assemble to any instruction least
> of all nop. You mean ignored here :).

Yes. ;)


More information about the Gcc mailing list