This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ARM inline assembly usage in Linux kernel


On 20 February 2014 10:11, Ramana Radhakrishnan
<ramana.gcc@googlemail.com> 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. ;)

cheers,
--renato


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]