The i370/s390 and vax sdiv_qrnnd macros expand n1 and n0 without
parentheses, so an argument containing a comma or an assignment is
misparsed. Every other use of these parameters in the file is already
parenthesized; libgcrypt fixed the same two sites in its copy.
Both blocks are 32-bit only and no in-tree caller passes such an
expression, so this is a latent bug fixed by inspection. The i370/s390
block compiles to identical assembly before and after with
s390x-linux-gnu-gcc -m31; there is no vax compiler here.
include/ChangeLog:
* longlong.h [__i370__, __s390__, __mvs__] (sdiv_qrnnd): Wrap
the n1 and n0 macro parameters in parentheses.
[__vax__] (sdiv_qrnnd): Likewise.
---
include/longlong.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git ./include/longlong.h ./include/longlong.h
index f12c90cdc73..6dc4e44b1b0 100644
--- ./include/longlong.h
+++ ./include/longlong.h
@@ -422,7 +422,7 @@ extern UDItype __umulsidi3 (USItype, USItype);
union {DItype __ll;
\
struct {USItype __h, __l;} __i; \
} __x; \
- __x.__i.__h = n1; __x.__i.__l = n0;
\
+ __x.__i.__h = (n1); __x.__i.__l = (n0); \
__asm__ ("dr %0,%2"
\
: "=r" (__x.__ll) \
: "0" (__x.__ll), "r" (d)); \
@@ -1518,7 +1518,7 @@ extern UDItype __umulsidi3 (USItype, USItype);
union {DItype __ll;
\
struct {SItype __l, __h;} __i; \
} __xx; \
- __xx.__i.__h = n1; __xx.__i.__l = n0; \
+ __xx.__i.__h = (n1); __xx.__i.__l = (n0); \
__asm__ ("ediv %3,%2,%0,%1"
\
: "=g" (q), "=g" (r) \
: "g" (__xx.__ll), "g" (d)); \
--
2.54.0