public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [stable:linux-4.14.y 4459/9999] lib/mpi/mpih-div.c:142:20: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions
@ 2023-08-03 21:32 kernel test robot
  2023-08-04 15:37 ` Nathan Chancellor
  0 siblings, 1 reply; 6+ messages in thread
From: kernel test robot @ 2023-08-03 21:32 UTC (permalink / raw)
  To: Fangrui Song
  Cc: llvm, oe-kbuild-all, Greg Kroah-Hartman, Nathan Chancellor,
	Nick Desaulniers, Masahiro Yamada

Hi Fangrui,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.14.y
head:   60a6e3043cc8b918c989707a5eba5fd6830a08a4
commit: 71749b1181eca12af96654a781cabcd058c37c8f [4459/9999] Makefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang cross compilation
config: mips-randconfig-r035-20230731 (https://download.01.org/0day-ci/archive/20230804/202308040553.nMR9oB8v-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230804/202308040553.nMR9oB8v-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308040553.nMR9oB8v-lkp@intel.com/

All errors (new ones prefixed by >>):

>> lib/mpi/mpih-div.c:142:20: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions
     142 |                                         umul_ppmm(n1, n0, d0, q);
         |                                         ~~~~~~~~~~~~~~^~~~~~~~~~
   lib/mpi/longlong.h:652:20: note: expanded from macro 'umul_ppmm'
     652 |         : "=l" ((USItype)(w0)), \
         |                 ~~~~~~~~~~^~~
>> lib/mpi/mpih-div.c:142:6: error: invalid output constraint '=h' in asm
     142 |                                         umul_ppmm(n1, n0, d0, q);
         |                                         ^
   lib/mpi/longlong.h:653:7: note: expanded from macro 'umul_ppmm'
     653 |              "=h" ((USItype)(w1)) \
         |              ^
   lib/mpi/mpih-div.c:205:20: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions
     205 |                                         umul_ppmm(n1, n0, d1, q);
         |                                         ~~~~~~~~~~~~~~^~~~~~~~~~
   lib/mpi/longlong.h:652:20: note: expanded from macro 'umul_ppmm'
     652 |         : "=l" ((USItype)(w0)), \
         |                 ~~~~~~~~~~^~~
   lib/mpi/mpih-div.c:205:6: error: invalid output constraint '=h' in asm
     205 |                                         umul_ppmm(n1, n0, d1, q);
         |                                         ^
   lib/mpi/longlong.h:653:7: note: expanded from macro 'umul_ppmm'
     653 |              "=h" ((USItype)(w1)) \
         |              ^
   4 errors generated.
--
>> lib/mpi/generic_mpih-mul1.c:50:24: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions
      50 |                 umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb);
         |                 ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   lib/mpi/longlong.h:652:20: note: expanded from macro 'umul_ppmm'
     652 |         : "=l" ((USItype)(w0)), \
         |                 ~~~~~~~~~~^~~
>> lib/mpi/generic_mpih-mul1.c:50:3: error: invalid output constraint '=h' in asm
      50 |                 umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb);
         |                 ^
   lib/mpi/longlong.h:653:7: note: expanded from macro 'umul_ppmm'
     653 |              "=h" ((USItype)(w1)) \
         |              ^
   2 errors generated.
--
   lib/mpi/generic_mpih-mul3.c:49:24: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions
      49 |                 umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb);
         |                 ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   lib/mpi/longlong.h:652:20: note: expanded from macro 'umul_ppmm'
     652 |         : "=l" ((USItype)(w0)), \
         |                 ~~~~~~~~~~^~~
>> lib/mpi/generic_mpih-mul3.c:49:3: error: invalid output constraint '=h' in asm
      49 |                 umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb);
         |                 ^
   lib/mpi/longlong.h:653:7: note: expanded from macro 'umul_ppmm'
     653 |              "=h" ((USItype)(w1)) \
         |              ^
   2 errors generated.
--
>> lib/mpi/generic_mpih-mul2.c:49:24: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions
      49 |                 umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb);
         |                 ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   lib/mpi/longlong.h:652:20: note: expanded from macro 'umul_ppmm'
     652 |         : "=l" ((USItype)(w0)), \
         |                 ~~~~~~~~~~^~~
>> lib/mpi/generic_mpih-mul2.c:49:3: error: invalid output constraint '=h' in asm
      49 |                 umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb);
         |                 ^
   lib/mpi/longlong.h:653:7: note: expanded from macro 'umul_ppmm'
     653 |              "=h" ((USItype)(w1)) \
         |              ^
   2 errors generated.


vim +142 lib/mpi/mpih-div.c

cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   39  
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   40  /* Divide num (NP/NSIZE) by den (DP/DSIZE) and write
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   41   * the NSIZE-DSIZE least significant quotient limbs at QP
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   42   * and the DSIZE long remainder at NP.	If QEXTRA_LIMBS is
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   43   * non-zero, generate that many fraction bits and append them after the
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   44   * other quotient limbs.
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   45   * Return the most significant limb of the quotient, this is always 0 or 1.
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   46   *
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   47   * Preconditions:
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   48   * 0. NSIZE >= DSIZE.
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   49   * 1. The most significant bit of the divisor must be set.
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   50   * 2. QP must either not overlap with the input operands at all, or
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   51   *    QP + DSIZE >= NP must hold true.	(This means that it's
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   52   *    possible to put the quotient in the high part of NUM, right after the
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   53   *    remainder in NUM.
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   54   * 3. NSIZE >= DSIZE, even if QEXTRA_LIMBS is non-zero.
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   55   */
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   56  
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   57  mpi_limb_t
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   58  mpihelp_divrem(mpi_ptr_t qp, mpi_size_t qextra_limbs,
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   59  	       mpi_ptr_t np, mpi_size_t nsize, mpi_ptr_t dp, mpi_size_t dsize)
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   60  {
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   61  	mpi_limb_t most_significant_q_limb = 0;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   62  
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   63  	switch (dsize) {
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   64  	case 0:
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   65  		/* We are asked to divide by zero, so go ahead and do it!  (To make
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   66  		   the compiler not remove this statement, return the value.)  */
a6d68ecc56ed18 Dmitry Kasatkin 2012-01-26   67  		/*
a6d68ecc56ed18 Dmitry Kasatkin 2012-01-26   68  		 * existing clients of this function have been modified
a6d68ecc56ed18 Dmitry Kasatkin 2012-01-26   69  		 * not to call it with dsize == 0, so this should not happen
a6d68ecc56ed18 Dmitry Kasatkin 2012-01-26   70  		 */
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   71  		return 1 / dsize;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   72  
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   73  	case 1:
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   74  		{
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   75  			mpi_size_t i;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   76  			mpi_limb_t n1;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   77  			mpi_limb_t d;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   78  
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   79  			d = dp[0];
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   80  			n1 = np[nsize - 1];
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   81  
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   82  			if (n1 >= d) {
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   83  				n1 -= d;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   84  				most_significant_q_limb = 1;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   85  			}
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   86  
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   87  			qp += qextra_limbs;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   88  			for (i = nsize - 2; i >= 0; i--)
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   89  				udiv_qrnnd(qp[i], n1, n1, np[i], d);
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   90  			qp -= qextra_limbs;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   91  
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   92  			for (i = qextra_limbs - 1; i >= 0; i--)
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   93  				udiv_qrnnd(qp[i], n1, n1, 0, d);
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   94  
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   95  			np[0] = n1;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   96  		}
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   97  		break;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   98  
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31   99  	case 2:
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  100  		{
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  101  			mpi_size_t i;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  102  			mpi_limb_t n1, n0, n2;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  103  			mpi_limb_t d1, d0;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  104  
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  105  			np += nsize - 2;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  106  			d1 = dp[1];
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  107  			d0 = dp[0];
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  108  			n1 = np[1];
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  109  			n0 = np[0];
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  110  
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  111  			if (n1 >= d1 && (n1 > d1 || n0 >= d0)) {
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  112  				sub_ddmmss(n1, n0, n1, n0, d1, d0);
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  113  				most_significant_q_limb = 1;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  114  			}
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  115  
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  116  			for (i = qextra_limbs + nsize - 2 - 1; i >= 0; i--) {
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  117  				mpi_limb_t q;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  118  				mpi_limb_t r;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  119  
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  120  				if (i >= qextra_limbs)
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  121  					np--;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  122  				else
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  123  					np[0] = 0;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  124  
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  125  				if (n1 == d1) {
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  126  					/* Q should be either 111..111 or 111..110.  Need special
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  127  					 * treatment of this rare case as normal division would
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  128  					 * give overflow.  */
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  129  					q = ~(mpi_limb_t) 0;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  130  
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  131  					r = n0 + d1;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  132  					if (r < d1) {	/* Carry in the addition? */
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  133  						add_ssaaaa(n1, n0, r - d0,
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  134  							   np[0], 0, d0);
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  135  						qp[i] = q;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  136  						continue;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  137  					}
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  138  					n1 = d0 - (d0 != 0 ? 1 : 0);
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  139  					n0 = -d0;
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  140  				} else {
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31  141  					udiv_qrnnd(q, r, n1, n0, d1);
cdec9cb5167ab1 Dmitry Kasatkin 2011-08-31 @142  					umul_ppmm(n1, n0, d0, q);

:::::: The code at line 142 was first introduced by commit
:::::: cdec9cb5167ab1113ba9c58e395f664d9d3f9acb crypto: GnuPG based MPI lib - source files (part 1)

:::::: TO: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
:::::: CC: Dmitry Kasatkin <dmitry.kasatkin@intel.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [stable:linux-4.14.y 4459/9999] lib/mpi/mpih-div.c:142:20: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions
  2023-08-03 21:32 [stable:linux-4.14.y 4459/9999] lib/mpi/mpih-div.c:142:20: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions kernel test robot
@ 2023-08-04 15:37 ` Nathan Chancellor
  2023-08-04 15:41   ` Nick Desaulniers
  0 siblings, 1 reply; 6+ messages in thread
From: Nathan Chancellor @ 2023-08-04 15:37 UTC (permalink / raw)
  To: kernel test robot
  Cc: Fangrui Song, llvm, oe-kbuild-all, Greg Kroah-Hartman,
	Nathan Chancellor, Nick Desaulniers, Masahiro Yamada

On Fri, Aug 04, 2023 at 05:32:55AM +0800, kernel test robot wrote:
> Hi Fangrui,
> 
> First bad commit (maybe != root cause):
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.14.y
> head:   60a6e3043cc8b918c989707a5eba5fd6830a08a4
> commit: 71749b1181eca12af96654a781cabcd058c37c8f [4459/9999] Makefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang cross compilation
> config: mips-randconfig-r035-20230731 (https://download.01.org/0day-ci/archive/20230804/202308040553.nMR9oB8v-lkp@intel.com/config)
> compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
> reproduce: (https://download.01.org/0day-ci/archive/20230804/202308040553.nMR9oB8v-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202308040553.nMR9oB8v-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
> >> lib/mpi/mpih-div.c:142:20: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions
>      142 |                                         umul_ppmm(n1, n0, d0, q);
>          |                                         ~~~~~~~~~~~~~~^~~~~~~~~~
>    lib/mpi/longlong.h:652:20: note: expanded from macro 'umul_ppmm'
>      652 |         : "=l" ((USItype)(w0)), \
>          |                 ~~~~~~~~~~^~~

This is the same as [1] but the upstream solution (b0c091ae04f6) could
cause breakage in 4.14 for compilers older than GCC 4.4; 4.14 claims to
support GCC 3.2 as a minimum version. An alternative solution if we care
about fixing this issue in 4.14 without any regression possiblity would
be something like:

diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h
index 6c5229f98c9e..42076c124e23 100644
--- a/lib/mpi/longlong.h
+++ b/lib/mpi/longlong.h
@@ -639,7 +639,7 @@ do { \
 	**************  MIPS  *****************
 	***************************************/
 #if defined(__mips__) && W_TYPE_SIZE == 32
-#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
+#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) || defined(__clang__)
 #define umul_ppmm(w1, w0, u, v)			\
 do {						\
 	UDItype __ll = (UDItype)(u) * (v);	\

[1]: https://lore.kernel.org/20230801202602.GA2589710@dev-arch.thelio-3990X/

Cheers,
Nathan

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [stable:linux-4.14.y 4459/9999] lib/mpi/mpih-div.c:142:20: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions
  2023-08-04 15:37 ` Nathan Chancellor
@ 2023-08-04 15:41   ` Nick Desaulniers
  2023-08-07  6:52     ` Liu, Yujie
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Desaulniers @ 2023-08-04 15:41 UTC (permalink / raw)
  To: Nathan Chancellor, kernel test robot
  Cc: Fangrui Song, llvm, oe-kbuild-all, Greg Kroah-Hartman,
	Nathan Chancellor, Masahiro Yamada

On Fri, Aug 4, 2023 at 8:37 AM Nathan Chancellor <nathan@kernel.org> wrote:
>
> On Fri, Aug 04, 2023 at 05:32:55AM +0800, kernel test robot wrote:
> > Hi Fangrui,
> >
> > First bad commit (maybe != root cause):
> >
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.14.y
> > head:   60a6e3043cc8b918c989707a5eba5fd6830a08a4
> > commit: 71749b1181eca12af96654a781cabcd058c37c8f [4459/9999] Makefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang cross compilation
> > config: mips-randconfig-r035-20230731 (https://download.01.org/0day-ci/archive/20230804/202308040553.nMR9oB8v-lkp@intel.com/config)
> > compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
> > reproduce: (https://download.01.org/0day-ci/archive/20230804/202308040553.nMR9oB8v-lkp@intel.com/reproduce)
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202308040553.nMR9oB8v-lkp@intel.com/
> >
> > All errors (new ones prefixed by >>):
> >
> > >> lib/mpi/mpih-div.c:142:20: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions
> >      142 |                                         umul_ppmm(n1, n0, d0, q);
> >          |                                         ~~~~~~~~~~~~~~^~~~~~~~~~
> >    lib/mpi/longlong.h:652:20: note: expanded from macro 'umul_ppmm'
> >      652 |         : "=l" ((USItype)(w0)), \
> >          |                 ~~~~~~~~~~^~~
>
> This is the same as [1] but the upstream solution (b0c091ae04f6) could
> cause breakage in 4.14 for compilers older than GCC 4.4; 4.14 claims to
> support GCC 3.2 as a minimum version. An alternative solution if we care
> about fixing this issue in 4.14 without any regression possiblity would
> be something like:

In our own CI, we don't test mips until 5.4.
https://github.com/ClangBuiltLinux/continuous-integration2/blob/main/generator.yml#L1691-L1698

Another solution is perhaps to ask kindly that the kernel test robot
team not test branches of stable w/ clang for ARCH=mips.


>
> diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h
> index 6c5229f98c9e..42076c124e23 100644
> --- a/lib/mpi/longlong.h
> +++ b/lib/mpi/longlong.h
> @@ -639,7 +639,7 @@ do { \
>         **************  MIPS  *****************
>         ***************************************/
>  #if defined(__mips__) && W_TYPE_SIZE == 32
> -#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
> +#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) || defined(__clang__)
>  #define umul_ppmm(w1, w0, u, v)                        \
>  do {                                           \
>         UDItype __ll = (UDItype)(u) * (v);      \
>
> [1]: https://lore.kernel.org/20230801202602.GA2589710@dev-arch.thelio-3990X/
>
> Cheers,
> Nathan
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [stable:linux-4.14.y 4459/9999] lib/mpi/mpih-div.c:142:20: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions
  2023-08-04 15:41   ` Nick Desaulniers
@ 2023-08-07  6:52     ` Liu, Yujie
  2023-08-07 16:19       ` Nick Desaulniers
  0 siblings, 1 reply; 6+ messages in thread
From: Liu, Yujie @ 2023-08-07  6:52 UTC (permalink / raw)
  To: nathan@kernel.org, ndesaulniers@google.com, lkp
  Cc: gregkh@linuxfoundation.org, masahiroy@kernel.org,
	maskray@google.com, llvm@lists.linux.dev,
	natechancellor@gmail.com, oe-kbuild-all@lists.linux.dev

On Fri, 2023-08-04 at 08:41 -0700, Nick Desaulniers wrote:
> On Fri, Aug 4, 2023 at 8:37 AM Nathan Chancellor <nathan@kernel.org>
> wrote:
> > 
> > On Fri, Aug 04, 2023 at 05:32:55AM +0800, kernel test robot wrote:
> > > Hi Fangrui,
> > > 
> > > First bad commit (maybe != root cause):
> > > 
> > > tree:  
> > > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
> > >  linux-4.14.y
> > > head:   60a6e3043cc8b918c989707a5eba5fd6830a08a4
> > > commit: 71749b1181eca12af96654a781cabcd058c37c8f [4459/9999]
> > > Makefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang cross
> > > compilation
> > > config: mips-randconfig-r035-20230731
> > > (https://download.01.org/0day-ci/archive/20230804/202308040553.nM
> > > R9oB8v-lkp@intel.com/config)
> > > compiler: clang version 17.0.0
> > > (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1
> > > ffa0299048db4c88a)
> > > reproduce:
> > > (https://download.01.org/0day-ci/archive/20230804/202308040553.nM
> > > R9oB8v-lkp@intel.com/reproduce)
> > > 
> > > If you fix the issue in a separate patch/commit (i.e. not just a
> > > new version of
> > > the same patch/commit), kindly add following tags
> > > > Reported-by: kernel test robot <lkp@intel.com>
> > > > Closes:
> > > > https://lore.kernel.org/oe-kbuild-all/202308040553.nMR9oB8v-lkp@intel.com/
> > > 
> > > All errors (new ones prefixed by >>):
> > > 
> > > > > lib/mpi/mpih-div.c:142:20: error: invalid use of a cast in a
> > > > > inline asm context requiring an lvalue: remove the cast or
> > > > > build with -fheinous-gnu-extensions
> > >      142 |                                         umul_ppmm(n1,
> > > n0, d0, q);
> > >          |                                        
> > > ~~~~~~~~~~~~~~^~~~~~~~~~
> > >    lib/mpi/longlong.h:652:20: note: expanded from macro
> > > 'umul_ppmm'
> > >      652 |         : "=l" ((USItype)(w0)), \
> > >          |                 ~~~~~~~~~~^~~
> > 
> > This is the same as [1] but the upstream solution (b0c091ae04f6)
> > could
> > cause breakage in 4.14 for compilers older than GCC 4.4; 4.14
> > claims to
> > support GCC 3.2 as a minimum version. An alternative solution if we
> > care
> > about fixing this issue in 4.14 without any regression possiblity
> > would
> > be something like:
> 
> In our own CI, we don't test mips until 5.4.
> https://github.com/ClangBuiltLinux/continuous-integration2/blob/main/generator.yml#L1691-L1698
> 
> Another solution is perhaps to ask kindly that the kernel test robot
> team not test branches of stable w/ clang for ARCH=mips.

Thanks for this info. We've configured the kernel test robot to do so.

--
Best Regards,
Yujie

> 
> > 
> > diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h
> > index 6c5229f98c9e..42076c124e23 100644
> > --- a/lib/mpi/longlong.h
> > +++ b/lib/mpi/longlong.h
> > @@ -639,7 +639,7 @@ do { \
> >         **************  MIPS  *****************
> >         ***************************************/
> >  #if defined(__mips__) && W_TYPE_SIZE == 32
> > -#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
> > +#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) ||
> > defined(__clang__)
> >  #define umul_ppmm(w1, w0, u, v)                        \
> >  do {                                           \
> >         UDItype __ll = (UDItype)(u) * (v);      \
> > 
> > [1]:
> > https://lore.kernel.org/20230801202602.GA2589710@dev-arch.thelio-3990X/
> > 
> > Cheers,
> > Nathan
> > 
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [stable:linux-4.14.y 4459/9999] lib/mpi/mpih-div.c:142:20: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions
  2023-08-07  6:52     ` Liu, Yujie
@ 2023-08-07 16:19       ` Nick Desaulniers
  2023-08-08  8:55         ` Liu, Yujie
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Desaulniers @ 2023-08-07 16:19 UTC (permalink / raw)
  To: Liu, Yujie
  Cc: nathan@kernel.org, lkp, llvm@lists.linux.dev,
	oe-kbuild-all@lists.linux.dev

On Sun, Aug 6, 2023 at 11:52 PM Liu, Yujie <yujie.liu@intel.com> wrote:
>
> On Fri, 2023-08-04 at 08:41 -0700, Nick Desaulniers wrote:
> > On Fri, Aug 4, 2023 at 8:37 AM Nathan Chancellor <nathan@kernel.org>
> > wrote:
> > >
> > > On Fri, Aug 04, 2023 at 05:32:55AM +0800, kernel test robot wrote:
> > > > Hi Fangrui,
> > > >
> > > > First bad commit (maybe != root cause):
> > > >
> > > > tree:
> > > > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
> > > >  linux-4.14.y
> > > > head:   60a6e3043cc8b918c989707a5eba5fd6830a08a4
> > > > commit: 71749b1181eca12af96654a781cabcd058c37c8f [4459/9999]
> > > > Makefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang cross
> > > > compilation
> > > > config: mips-randconfig-r035-20230731
> > > > (https://download.01.org/0day-ci/archive/20230804/202308040553.nM
> > > > R9oB8v-lkp@intel.com/config)
> > > > compiler: clang version 17.0.0
> > > > (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1
> > > > ffa0299048db4c88a)
> > > > reproduce:
> > > > (https://download.01.org/0day-ci/archive/20230804/202308040553.nM
> > > > R9oB8v-lkp@intel.com/reproduce)
> > > >
> > > > If you fix the issue in a separate patch/commit (i.e. not just a
> > > > new version of
> > > > the same patch/commit), kindly add following tags
> > > > > Reported-by: kernel test robot <lkp@intel.com>
> > > > > Closes:
> > > > > https://lore.kernel.org/oe-kbuild-all/202308040553.nMR9oB8v-lkp@intel.com/
> > > >
> > > > All errors (new ones prefixed by >>):
> > > >
> > > > > > lib/mpi/mpih-div.c:142:20: error: invalid use of a cast in a
> > > > > > inline asm context requiring an lvalue: remove the cast or
> > > > > > build with -fheinous-gnu-extensions
> > > >      142 |                                         umul_ppmm(n1,
> > > > n0, d0, q);
> > > >          |
> > > > ~~~~~~~~~~~~~~^~~~~~~~~~
> > > >    lib/mpi/longlong.h:652:20: note: expanded from macro
> > > > 'umul_ppmm'
> > > >      652 |         : "=l" ((USItype)(w0)), \
> > > >          |                 ~~~~~~~~~~^~~
> > >
> > > This is the same as [1] but the upstream solution (b0c091ae04f6)
> > > could
> > > cause breakage in 4.14 for compilers older than GCC 4.4; 4.14
> > > claims to
> > > support GCC 3.2 as a minimum version. An alternative solution if we
> > > care
> > > about fixing this issue in 4.14 without any regression possiblity
> > > would
> > > be something like:
> >
> > In our own CI, we don't test mips until 5.4.
> > https://github.com/ClangBuiltLinux/continuous-integration2/blob/main/generator.yml#L1691-L1698
> >
> > Another solution is perhaps to ask kindly that the kernel test robot
> > team not test branches of stable w/ clang for ARCH=mips.

^ specifically branches linux-4.19.y and linux-4.14.y.  Newer branches
should be tested for ARCH=mips LLVM=1.

>
> Thanks for this info. We've configured the kernel test robot to do so.
>
> --
> Best Regards,
> Yujie
>
> >
> > >
> > > diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h
> > > index 6c5229f98c9e..42076c124e23 100644
> > > --- a/lib/mpi/longlong.h
> > > +++ b/lib/mpi/longlong.h
> > > @@ -639,7 +639,7 @@ do { \
> > >         **************  MIPS  *****************
> > >         ***************************************/
> > >  #if defined(__mips__) && W_TYPE_SIZE == 32
> > > -#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
> > > +#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) ||
> > > defined(__clang__)
> > >  #define umul_ppmm(w1, w0, u, v)                        \
> > >  do {                                           \
> > >         UDItype __ll = (UDItype)(u) * (v);      \
> > >
> > > [1]:
> > > https://lore.kernel.org/20230801202602.GA2589710@dev-arch.thelio-3990X/
> > >
> > > Cheers,
> > > Nathan
> > >
> >
> >
>


-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [stable:linux-4.14.y 4459/9999] lib/mpi/mpih-div.c:142:20: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions
  2023-08-07 16:19       ` Nick Desaulniers
@ 2023-08-08  8:55         ` Liu, Yujie
  0 siblings, 0 replies; 6+ messages in thread
From: Liu, Yujie @ 2023-08-08  8:55 UTC (permalink / raw)
  To: ndesaulniers@google.com
  Cc: nathan@kernel.org, llvm@lists.linux.dev, lkp,
	oe-kbuild-all@lists.linux.dev

On Mon, 2023-08-07 at 09:19 -0700, Nick Desaulniers wrote:
> On Sun, Aug 6, 2023 at 11:52 PM Liu, Yujie <yujie.liu@intel.com>
> wrote:
> > 
> > On Fri, 2023-08-04 at 08:41 -0700, Nick Desaulniers wrote:
> > > On Fri, Aug 4, 2023 at 8:37 AM Nathan Chancellor
> > > <nathan@kernel.org>
> > > wrote:
> > > > 
> > > > On Fri, Aug 04, 2023 at 05:32:55AM +0800, kernel test robot
> > > > wrote:
> > > > > Hi Fangrui,
> > > > > 
> > > > > First bad commit (maybe != root cause):
> > > > > 
> > > > > tree:
> > > > > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
> > > > >  linux-4.14.y
> > > > > head:   60a6e3043cc8b918c989707a5eba5fd6830a08a4
> > > > > commit: 71749b1181eca12af96654a781cabcd058c37c8f [4459/9999]
> > > > > Makefile: Fix GCC_TOOLCHAIN_DIR prefix for Clang cross
> > > > > compilation
> > > > > config: mips-randconfig-r035-20230731
> > > > > (
> > > > > https://download.01.org/0day-ci/archive/20230804/202308040553.
> > > > > nM
> > > > > R9oB8v-lkp@intel.com/config)
> > > > > compiler: clang version 17.0.0
> > > > > (
> > > > > https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2c
> > > > > c1
> > > > > ffa0299048db4c88a)
> > > > > reproduce:
> > > > > (
> > > > > https://download.01.org/0day-ci/archive/20230804/202308040553.
> > > > > nM
> > > > > R9oB8v-lkp@intel.com/reproduce)
> > > > > 
> > > > > If you fix the issue in a separate patch/commit (i.e. not
> > > > > just a
> > > > > new version of
> > > > > the same patch/commit), kindly add following tags
> > > > > > Reported-by: kernel test robot <lkp@intel.com>
> > > > > > Closes:
> > > > > > https://lore.kernel.org/oe-kbuild-all/202308040553.nMR9oB8v-lkp@intel.com/
> > > > > 
> > > > > All errors (new ones prefixed by >>):
> > > > > 
> > > > > > > lib/mpi/mpih-div.c:142:20: error: invalid use of a cast
> > > > > > > in a
> > > > > > > inline asm context requiring an lvalue: remove the cast
> > > > > > > or
> > > > > > > build with -fheinous-gnu-extensions
> > > > >      142 |                                        
> > > > > umul_ppmm(n1,
> > > > > n0, d0, q);
> > > > >          |
> > > > > ~~~~~~~~~~~~~~^~~~~~~~~~
> > > > >    lib/mpi/longlong.h:652:20: note: expanded from macro
> > > > > 'umul_ppmm'
> > > > >      652 |         : "=l" ((USItype)(w0)), \
> > > > >          |                 ~~~~~~~~~~^~~
> > > > 
> > > > This is the same as [1] but the upstream solution
> > > > (b0c091ae04f6)
> > > > could
> > > > cause breakage in 4.14 for compilers older than GCC 4.4; 4.14
> > > > claims to
> > > > support GCC 3.2 as a minimum version. An alternative solution
> > > > if we
> > > > care
> > > > about fixing this issue in 4.14 without any regression
> > > > possiblity
> > > > would
> > > > be something like:
> > > 
> > > In our own CI, we don't test mips until 5.4.
> > > https://github.com/ClangBuiltLinux/continuous-integration2/blob/main/generator.yml#L1691-L1698
> > > 
> > > Another solution is perhaps to ask kindly that the kernel test
> > > robot
> > > team not test branches of stable w/ clang for ARCH=mips.
> 
> ^ specifically branches linux-4.19.y and linux-4.14.y.  Newer
> branches
> should be tested for ARCH=mips LLVM=1.

Thanks, we've updated the bot's configuration as suggested above.

--
Best Regards,
Yujie

> > 
> > Thanks for this info. We've configured the kernel test robot to do
> > so.
> > 
> > --
> > Best Regards,
> > Yujie
> > 
> > > 
> > > > 
> > > > diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h
> > > > index 6c5229f98c9e..42076c124e23 100644
> > > > --- a/lib/mpi/longlong.h
> > > > +++ b/lib/mpi/longlong.h
> > > > @@ -639,7 +639,7 @@ do { \
> > > >         **************  MIPS  *****************
> > > >         ***************************************/
> > > >  #if defined(__mips__) && W_TYPE_SIZE == 32
> > > > -#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
> > > > +#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
> > > > ||
> > > > defined(__clang__)
> > > >  #define umul_ppmm(w1, w0, u, v)                        \
> > > >  do {                                           \
> > > >         UDItype __ll = (UDItype)(u) * (v);      \
> > > > 
> > > > [1]:
> > > > https://lore.kernel.org/20230801202602.GA2589710@dev-arch.thelio-3990X/
> > > > 
> > > > Cheers,
> > > > Nathan
> > > > 
> > > 
> > > 
> > 
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-08-08  8:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-03 21:32 [stable:linux-4.14.y 4459/9999] lib/mpi/mpih-div.c:142:20: error: invalid use of a cast in a inline asm context requiring an lvalue: remove the cast or build with -fheinous-gnu-extensions kernel test robot
2023-08-04 15:37 ` Nathan Chancellor
2023-08-04 15:41   ` Nick Desaulniers
2023-08-07  6:52     ` Liu, Yujie
2023-08-07 16:19       ` Nick Desaulniers
2023-08-08  8:55         ` Liu, Yujie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox