Skip to content

Commit 5990cde

Browse files
nathanchancempe
authored andcommitted
lib/mpi: Fix building for powerpc with clang
0day reports over and over on an powerpc randconfig with clang: 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 Remove the superfluous casts, which have been done previously for x86 and arm32 in commit dea632c ("lib/mpi: fix build with clang") and commit 7b7c1df ("lib/mpi/longlong.h: fix building with 32-bit x86"). Reported-by: kbuild test robot <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Acked-by: Herbert Xu <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: ClangBuiltLinux#991 Link: https://lore.kernel.org/r/[email protected]
1 parent feb8e96 commit 5990cde

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

lib/mpi/longlong.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -722,22 +722,22 @@ do { \
722722
do { \
723723
if (__builtin_constant_p(bh) && (bh) == 0) \
724724
__asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \
725-
: "=r" ((USItype)(sh)), \
726-
"=&r" ((USItype)(sl)) \
725+
: "=r" (sh), \
726+
"=&r" (sl) \
727727
: "%r" ((USItype)(ah)), \
728728
"%r" ((USItype)(al)), \
729729
"rI" ((USItype)(bl))); \
730730
else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \
731731
__asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \
732-
: "=r" ((USItype)(sh)), \
733-
"=&r" ((USItype)(sl)) \
732+
: "=r" (sh), \
733+
"=&r" (sl) \
734734
: "%r" ((USItype)(ah)), \
735735
"%r" ((USItype)(al)), \
736736
"rI" ((USItype)(bl))); \
737737
else \
738738
__asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \
739-
: "=r" ((USItype)(sh)), \
740-
"=&r" ((USItype)(sl)) \
739+
: "=r" (sh), \
740+
"=&r" (sl) \
741741
: "%r" ((USItype)(ah)), \
742742
"r" ((USItype)(bh)), \
743743
"%r" ((USItype)(al)), \
@@ -747,36 +747,36 @@ do { \
747747
do { \
748748
if (__builtin_constant_p(ah) && (ah) == 0) \
749749
__asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \
750-
: "=r" ((USItype)(sh)), \
751-
"=&r" ((USItype)(sl)) \
750+
: "=r" (sh), \
751+
"=&r" (sl) \
752752
: "r" ((USItype)(bh)), \
753753
"rI" ((USItype)(al)), \
754754
"r" ((USItype)(bl))); \
755755
else if (__builtin_constant_p(ah) && (ah) == ~(USItype) 0) \
756756
__asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \
757-
: "=r" ((USItype)(sh)), \
758-
"=&r" ((USItype)(sl)) \
757+
: "=r" (sh), \
758+
"=&r" (sl) \
759759
: "r" ((USItype)(bh)), \
760760
"rI" ((USItype)(al)), \
761761
"r" ((USItype)(bl))); \
762762
else if (__builtin_constant_p(bh) && (bh) == 0) \
763763
__asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \
764-
: "=r" ((USItype)(sh)), \
765-
"=&r" ((USItype)(sl)) \
764+
: "=r" (sh), \
765+
"=&r" (sl) \
766766
: "r" ((USItype)(ah)), \
767767
"rI" ((USItype)(al)), \
768768
"r" ((USItype)(bl))); \
769769
else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \
770770
__asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \
771-
: "=r" ((USItype)(sh)), \
772-
"=&r" ((USItype)(sl)) \
771+
: "=r" (sh), \
772+
"=&r" (sl) \
773773
: "r" ((USItype)(ah)), \
774774
"rI" ((USItype)(al)), \
775775
"r" ((USItype)(bl))); \
776776
else \
777777
__asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \
778-
: "=r" ((USItype)(sh)), \
779-
"=&r" ((USItype)(sl)) \
778+
: "=r" (sh), \
779+
"=&r" (sl) \
780780
: "r" ((USItype)(ah)), \
781781
"r" ((USItype)(bh)), \
782782
"rI" ((USItype)(al)), \
@@ -787,7 +787,7 @@ do { \
787787
do { \
788788
USItype __m0 = (m0), __m1 = (m1); \
789789
__asm__ ("mulhwu %0,%1,%2" \
790-
: "=r" ((USItype) ph) \
790+
: "=r" (ph) \
791791
: "%r" (__m0), \
792792
"r" (__m1)); \
793793
(pl) = __m0 * __m1; \

0 commit comments

Comments
 (0)