Re: lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions

From: Nathan Chancellor
Date: Thu Apr 23 2020 - 12:33:17 EST


On Thu, Apr 23, 2020 at 08:00:47PM +0800, kbuild test robot wrote:
> Hi Dirk,
>
> First bad commit (maybe != root cause):
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: c578ddb39e565139897124e74e5a43e56538cb33
> commit: e33a814e772cdc36436c8c188d8c42d019fda639 scripts/dtc: Remove redundant YYLOC global declaration
> date: 4 weeks ago
> config: powerpc-randconfig-a001-20200423 (attached as .config)
> compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project bbf386f02b05db017fda66875cc5edef70779244)
> reproduce:
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # install powerpc cross compiling tool for clang build
> # apt-get install binutils-powerpc-linux-gnu
> git checkout e33a814e772cdc36436c8c188d8c42d019fda639
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kbuild test robot <lkp@xxxxxxxxx>
>
> All errors (new ones prefixed by >>):
>
> >> lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb);
> ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> lib/mpi/longlong.h:790:20: note: expanded from macro 'umul_ppmm'
> : "=r" ((USItype) ph) \
> ~~~~~~~~~~^~
> 1 error generated.
> --
> >> lib/mpi/generic_mpih-mul2.c:36:13: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb);
> ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> lib/mpi/longlong.h:790:20: note: expanded from macro 'umul_ppmm'
> : "=r" ((USItype) ph) \
> ~~~~~~~~~~^~
> 1 error generated.
> --
> >> lib/mpi/generic_mpih-mul3.c:36:13: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb);
> ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> lib/mpi/longlong.h:790:20: note: expanded from macro 'umul_ppmm'
> : "=r" ((USItype) ph) \
> ~~~~~~~~~~^~
> 1 error generated.
> --
> >> lib/mpi/mpih-div.c:99:16: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> sub_ddmmss(n1, n0, n1, n0, d1, d0);
> ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
> lib/mpi/longlong.h:750:21: note: expanded from macro 'sub_ddmmss'
> : "=r" ((USItype)(sh)), \
> ~~~~~~~~~~^~~
> lib/mpi/mpih-div.c:99:20: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> sub_ddmmss(n1, n0, n1, n0, d1, d0);
> ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
> lib/mpi/longlong.h:751:20: note: expanded from macro 'sub_ddmmss'
> "=&r" ((USItype)(sl)) \
> ~~~~~~~~~~^~~
> >> lib/mpi/mpih-div.c:99:16: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> sub_ddmmss(n1, n0, n1, n0, d1, d0);
> ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
> lib/mpi/longlong.h:757:21: note: expanded from macro 'sub_ddmmss'
> : "=r" ((USItype)(sh)), \
> ~~~~~~~~~~^~~
> lib/mpi/mpih-div.c:99:20: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> sub_ddmmss(n1, n0, n1, n0, d1, d0);
> ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
> lib/mpi/longlong.h:758:20: note: expanded from macro 'sub_ddmmss'
> "=&r" ((USItype)(sl)) \
> ~~~~~~~~~~^~~
> >> lib/mpi/mpih-div.c:99:16: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> sub_ddmmss(n1, n0, n1, n0, d1, d0);
> ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
> lib/mpi/longlong.h:764:21: note: expanded from macro 'sub_ddmmss'
> : "=r" ((USItype)(sh)), \
> ~~~~~~~~~~^~~
> lib/mpi/mpih-div.c:99:20: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> sub_ddmmss(n1, n0, n1, n0, d1, d0);
> ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
> lib/mpi/longlong.h:765:20: note: expanded from macro 'sub_ddmmss'
> "=&r" ((USItype)(sl)) \
> ~~~~~~~~~~^~~
> >> lib/mpi/mpih-div.c:99:16: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> sub_ddmmss(n1, n0, n1, n0, d1, d0);
> ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
> lib/mpi/longlong.h:771:21: note: expanded from macro 'sub_ddmmss'
> : "=r" ((USItype)(sh)), \
> ~~~~~~~~~~^~~
> lib/mpi/mpih-div.c:99:20: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> sub_ddmmss(n1, n0, n1, n0, d1, d0);
> ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
> lib/mpi/longlong.h:772:20: note: expanded from macro 'sub_ddmmss'
> "=&r" ((USItype)(sl)) \
> ~~~~~~~~~~^~~
> >> lib/mpi/mpih-div.c:99:16: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> sub_ddmmss(n1, n0, n1, n0, d1, d0);
> ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
> lib/mpi/longlong.h:778:21: note: expanded from macro 'sub_ddmmss'
> : "=r" ((USItype)(sh)), \
> ~~~~~~~~~~^~~
> lib/mpi/mpih-div.c:99:20: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> sub_ddmmss(n1, n0, n1, n0, d1, d0);
> ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
> lib/mpi/longlong.h:779:20: note: expanded from macro 'sub_ddmmss'
> "=&r" ((USItype)(sl)) \
> ~~~~~~~~~~^~~
> lib/mpi/mpih-div.c:120:18: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> add_ssaaaa(n1, n0, r - d0,
> ~~~~~~~~~~~^~~~~~~~~~~~~~~
> lib/mpi/longlong.h:725:21: note: expanded from macro 'add_ssaaaa'
> : "=r" ((USItype)(sh)), \
> ~~~~~~~~~~^~~
> lib/mpi/mpih-div.c:120:22: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> add_ssaaaa(n1, n0, r - d0,
> ~~~~~~~~~~~~~~~^~~~~~~~~~~
> lib/mpi/longlong.h:726:20: note: expanded from macro 'add_ssaaaa'
> "=&r" ((USItype)(sl)) \
> ~~~~~~~~~~^~~
> lib/mpi/mpih-div.c:120:18: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> add_ssaaaa(n1, n0, r - d0,
> ~~~~~~~~~~~^~~~~~~~~~~~~~~
> lib/mpi/longlong.h:732:21: note: expanded from macro 'add_ssaaaa'
> : "=r" ((USItype)(sh)), \
> ~~~~~~~~~~^~~
> lib/mpi/mpih-div.c:120:22: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> add_ssaaaa(n1, n0, r - d0,
> ~~~~~~~~~~~~~~~^~~~~~~~~~~
> lib/mpi/longlong.h:733:20: note: expanded from macro 'add_ssaaaa'
> "=&r" ((USItype)(sl)) \
> ~~~~~~~~~~^~~
> lib/mpi/mpih-div.c:120:18: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> add_ssaaaa(n1, n0, r - d0,
> ~~~~~~~~~~~^~~~~~~~~~~~~~~
> lib/mpi/longlong.h:739:21: note: expanded from macro 'add_ssaaaa'
> : "=r" ((USItype)(sh)), \
> ~~~~~~~~~~^~~
> lib/mpi/mpih-div.c:120:22: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> add_ssaaaa(n1, n0, r - d0,
> ~~~~~~~~~~~~~~~^~~~~~~~~~~
> lib/mpi/longlong.h:740:20: note: expanded from macro 'add_ssaaaa'
> "=&r" ((USItype)(sl)) \
> ~~~~~~~~~~^~~
> lib/mpi/mpih-div.c:129:16: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> umul_ppmm(n1, n0, d0, q);
> ~~~~~~~~~~^~~~~~~~~~~~~~
> lib/mpi/longlong.h:790:20: note: expanded from macro 'umul_ppmm'
> : "=r" ((USItype) ph) \
> ~~~~~~~~~~^~
> lib/mpi/mpih-div.c:137:17: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> sub_ddmmss(n1, n0, n1, n0, 0, d0);
> ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
> lib/mpi/longlong.h:750:21: note: expanded from macro 'sub_ddmmss'
> : "=r" ((USItype)(sh)), \
> ~~~~~~~~~~^~~
> lib/mpi/mpih-div.c:137:21: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
> sub_ddmmss(n1, n0, n1, n0, 0, d0);
> ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
> lib/mpi/longlong.h:751:20: note: expanded from macro 'sub_ddmmss'
> "=&r" ((USItype)(sl)) \
> ~~~~~~~~~~^~~
> fatal error: too many errors emitted, stopping now [-ferror-limit=]
> 20 errors generated.
>
> vim +37 lib/mpi/generic_mpih-mul1.c

Obviously not caused by that commit but I sent a patch a week and a half
ago:

https://lore.kernel.org/lkml/20200413195041.24064-1-natechancellor@xxxxxxxxx/

https://github.com/ClangBuiltLinux/linux/issues/991

Cheers,
Nathan