Skip to content

Commit bb2e0fb

Browse files
committed
m68k: libgcc: Fix lvalue abuse in umul_ppmm()
lib/muldi3.c:53:28: warning: asm output is not an lvalue lib/muldi3.c:53:28: warning: asm output is not an lvalue lib/muldi3.c:53:28: error: not addressable lib/muldi3.c:53:28: warning: generating address of non-lvalue (11) lib/muldi3.c:53:28: warning: generating address of non-lvalue (11) Fix the lvalue warnings by replacing the casts on the output operands by intermediate variables of the right type. Fix the "not addressable" error by replacing the cast on the second input operand by an intermediate variable, too. Treat the other input operand the same for consistency. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202501030516.uZrwnuQQ-lkp@intel.com/ Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Greg Ungerer <gerg@linux-m68k.org> Link: https://lore.kernel.org/c408cfb85bfde8929dcaa4ebea29ade4e1452d8e.1736356696.git.geert@linux-m68k.org
1 parent 5303693 commit bb2e0fb

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

arch/m68k/include/asm/libgcc.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,18 @@
1010
* will fallback to using the C-coded version of umul_ppmm().
1111
*/
1212
#define umul_ppmm(w1, w0, u, v) \
13-
__asm__ ("mulu%.l %3,%1:%0" \
14-
: "=d" ((unsigned long)(w0)), \
15-
"=d" ((unsigned long)(w1)) \
16-
: "%0" ((unsigned long)(u)), \
17-
"dmi" ((unsigned long)(v)))
13+
do { \
14+
unsigned long __u = (u), __v = (v); \
15+
unsigned long __w0, __w1; \
16+
\
17+
__asm__ ("mulu%.l %3,%1:%0" \
18+
: "=d" (__w0), \
19+
"=d" (__w1) \
20+
: "%0" (__u), \
21+
"dmi" (__v)); \
22+
\
23+
(w0) = __w0; (w1) = __w1; \
24+
} while (0)
1825
#endif /* !CONFIG_CPU_HAS_NO_MULDIV64 */
1926

2027
#endif /* __ASM_M68K_LIBGCC_H */

0 commit comments

Comments
 (0)