aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-12-14 22:06:29 +1030
committerAlan Modra <amodra@gmail.com>2021-12-15 09:20:59 +1030
commita078dd9ce81537fa01356c12283bf14f29b36439 (patch)
tree8244ed0197edab1fae8647c8ce2cb1da356042bb /gas
parenteda0ddeb26a117660f3c0f54572053117641c2c3 (diff)
downloadgdb-a078dd9ce81537fa01356c12283bf14f29b36439.zip
gdb-a078dd9ce81537fa01356c12283bf14f29b36439.tar.gz
gdb-a078dd9ce81537fa01356c12283bf14f29b36439.tar.bz2
loongarch64 build failure on 32-bit host
gas/config/tc-loongarch.c: In function ‘loongarch_args_parser_can_match_arg_helper’: gas/config/tc-loongarch.c:661:13: error: cast from pointer to integer of different size [-Werror=pointer -to-int-cast] 661 | imm = (offsetT) str_hash_find (r_htab, arg); | ^ Cast it to the correct size int, relying on normal integer promotions if offsetT is larger than a pointer. * config/tc-loongarch.c (loongarch_args_parser_can_match_arg_helper): Cast return from str_hash_find to intptr_t, not offsetT.
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-loongarch.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gas/config/tc-loongarch.c b/gas/config/tc-loongarch.c
index f7235a1..7607d1d 100644
--- a/gas/config/tc-loongarch.c
+++ b/gas/config/tc-loongarch.c
@@ -658,12 +658,12 @@ loongarch_args_parser_can_match_arg_helper (char esc_ch1, char esc_ch2,
}
break;
case 'r':
- imm = (offsetT) str_hash_find (r_htab, arg);
+ imm = (intptr_t) str_hash_find (r_htab, arg);
ip->match_now = 0 < imm;
ret = imm - 1;
break;
case 'f':
- imm = (offsetT) str_hash_find (f_htab, arg);
+ imm = (intptr_t) str_hash_find (f_htab, arg);
ip->match_now = 0 < imm;
ret = imm - 1;
break;
@@ -671,21 +671,21 @@ loongarch_args_parser_can_match_arg_helper (char esc_ch1, char esc_ch2,
switch (esc_ch2)
{
case 'r':
- imm = (offsetT) str_hash_find (cr_htab, arg);
+ imm = (intptr_t) str_hash_find (cr_htab, arg);
break;
default:
- imm = (offsetT) str_hash_find (c_htab, arg);
+ imm = (intptr_t) str_hash_find (c_htab, arg);
}
ip->match_now = 0 < imm;
ret = imm - 1;
break;
case 'v':
- imm = (offsetT) str_hash_find (v_htab, arg);
+ imm = (intptr_t) str_hash_find (v_htab, arg);
ip->match_now = 0 < imm;
ret = imm - 1;
break;
case 'x':
- imm = (offsetT) str_hash_find (x_htab, arg);
+ imm = (intptr_t) str_hash_find (x_htab, arg);
ip->match_now = 0 < imm;
ret = imm - 1;
break;