public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Fangrui Song <maskray@google.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Nathan Chancellor <natechancellor@gmail.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Masahiro Yamada <masahiroy@kernel.org>
Subject: [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
Date: Fri, 4 Aug 2023 05:32:55 +0800	[thread overview]
Message-ID: <202308040553.nMR9oB8v-lkp@intel.com> (raw)

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

             reply	other threads:[~2023-08-03 21:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03 21:32 kernel test robot [this message]
2023-08-04 15:37 ` [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 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202308040553.nMR9oB8v-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=llvm@lists.linux.dev \
    --cc=masahiroy@kernel.org \
    --cc=maskray@google.com \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox