On Mon, Jul 22, 2019 at 12:39 PM Jan Beulich <jbeul...@suse.com> wrote: > On 22.07.2019 12:10, Thomas Gleixner wrote: > > On Thu, 11 Jul 2019, Arnd Bergmann wrote: > "q" was used in that commit exclusively for byte sized operands, simply > because that _is_ the constraint to use in such cases. Using "r" is > wrong on 32-bit, as it would include inaccessible byte portions of %sp, > %bp, %si, and %di. This is how it's described in gcc sources / docs: > > "Any register accessible as @code{@var{r}l}. In 32-bit mode, @code{a}, > @code{b}, @code{c}, and @code{d}; in 64-bit mode, any integer register." > > What I'm struggling with is why clang would evaluate that asm() in the > first place when a 64-bit field (perf_ctr_virt_mask) is being accessed.
clang does the optimization and warning checking in a different order, in this case the argument type checks for the inline assembly is done before it eliminates the dead code. Arnd