This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ARM inline assembly usage in Linux kernel
- From: Renato Golin <renato dot golin at linaro dot org>
- To: ramrad01 at arm dot com
- Cc: Andrew Pinski <pinskia at gmail dot com>, Saleem Abdulrasool <compnerd at compnerd dot org>, GCC Mailing List <gcc at gcc dot gnu dot org>, Richard Sandiford <rsandifo at linux dot vnet dot ibm dot com>
- Date: Thu, 20 Feb 2014 10:21:33 +0000
- Subject: Re: ARM inline assembly usage in Linux kernel
- Authentication-results: sourceware.org; auth=none
- References: <20140219025428 dot GA5417 at lithium dot compnerd dot org> <CA+=Sn1kr+Vjf8bRRvg7nTzdPw3YCgHPYff4vFBEyN3jJFcZRQw at mail dot gmail dot com> <87sirfjovh dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com> <CAMSE1kc3e=o1PxZj06ZUmxT+qbYrTz6oqELgDOGW8roOvWEZMQ at mail dot gmail dot com> <CA+=Sn1=hk63Fna77h1aWypaZt=p+u-4XzuO303=aWOZri=5Tsw at mail dot gmail dot com> <CAJA7tRbinjVV9yCQo_J83iyC7kH-hOLwxeTwMqwNLVyyPpEbUg at mail dot gmail dot com>
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