Subject: Re: [PATCH] powerpc/math-emu: Fix building with clang

From: Segher Boessenkool <[email-masked]>
Date: Fri, 2 Nov 2018 13:44:14 -0500

On Fri, Nov 02, 2018 at 10:38:36AM -0700, Nick Desaulniers wrote:
> On Fri, Nov 2, 2018 at 10:34 AM Segher Boessenkool
> <[email-masked]> wrote:
> >
> > On Fri, Nov 02, 2018 at 02:07:13PM +1030, Joel Stanley wrote:
> > >   arch/powerpc/math-emu/fnmsub.c:46:2: error: invalid use of a cast in a
> > >   inline asm context requiring an l-value: remove the cast or build with
> > >   -fheinous-gnu-extensions
> >
> > (It is spelled lvalue).
> >
> > *All* of extended asm is a GNU extension, what is clang trying to say here?
> > Confused :-)
> 
> Isn't the result of a cast a temporary value?  Probably just need to
> move the case out of the inline asm block to a separate statement.
> Having the full backtrace should help.

The kernel's sfp-machine.h has casts in lvalues, inside macros.  All such
casts seem to be casts to compatible types (and if not, it probably won't
work with GCC either).

Segher