aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-01-31 14:38:45 +1030
committerAlan Modra <amodra@gmail.com>2019-01-31 14:45:01 +1030
commit3ca4a8eca78b4d5e3fa308dbd21c67ebef09a261 (patch)
tree2d370bc624580b5e7bc70c06f79a6e5cee39ad51
parent4f4690cd42476b0907b51a410fc026bfc94c66d2 (diff)
downloadgdb-3ca4a8eca78b4d5e3fa308dbd21c67ebef09a261.zip
gdb-3ca4a8eca78b4d5e3fa308dbd21c67ebef09a261.tar.gz
gdb-3ca4a8eca78b4d5e3fa308dbd21c67ebef09a261.tar.bz2
Assorted warning fixes
gcc-9 flagged warnings at the places I'm patching here, all real bugs. * config/tc-alpha.c (md_apply_fix): Correct range checks for BFD_RELOC_ALPHA_NOP, BFD_RELOC_ALPHA_LDA, BFD_RELOC_ALPHA_BSR. * config/tc-arm.c (md_apply_fix): Use llabs rather than abs. * config/tc-csky.c (get_macro_reg_vals): Pass s to csky_show_error.
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-alpha.c6
-rw-r--r--gas/config/tc-arm.c8
-rw-r--r--gas/config/tc-csky.c2
4 files changed, 15 insertions, 8 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 5e2d813..e6c63d1 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2019-01-31 Alan Modra <amodra@gmail.com>
+
+ * config/tc-alpha.c (md_apply_fix): Correct range checks for
+ BFD_RELOC_ALPHA_NOP, BFD_RELOC_ALPHA_LDA, BFD_RELOC_ALPHA_BSR.
+ * config/tc-arm.c (md_apply_fix): Use llabs rather than abs.
+ * config/tc-csky.c (get_macro_reg_vals): Pass s to csky_show_error.
+
2019-01-28 Max Filippov <jcmvbkbc@gmail.com>
* config/tc-xtensa.c (md_apply_fix): Mark fixups for constant
diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c
index 606f201..7f80036 100644
--- a/gas/config/tc-alpha.c
+++ b/gas/config/tc-alpha.c
@@ -5878,7 +5878,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg)
return;
}
- if ((abs (value) >> 2) & ~0xfffff)
+ if (value + (1u << 22) >= (1u << 23))
goto done;
else
{
@@ -5897,7 +5897,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg)
return;
}
- if ((abs (value)) & ~0x7fff)
+ if (value + (1u << 15) >= (1u << 16))
goto done;
else
{
@@ -5917,7 +5917,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg)
return;
}
- if ((abs (value) >> 2) & ~0xfffff)
+ if (value + (1u << 22) >= (1u << 23))
{
/* Out of range. */
if (fixP->fx_r_type == BFD_RELOC_ALPHA_BOH)
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index da5dd25..81b5cee 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -24507,7 +24507,7 @@ md_apply_fix (fixS * fixP,
{
bfd_vma insn;
bfd_vma encoded_addend;
- bfd_vma addend_abs = abs (value);
+ bfd_vma addend_abs = llabs (value);
/* Check that the absolute value of the addend can be
expressed as an 8-bit constant plus a rotation. */
@@ -24548,7 +24548,7 @@ md_apply_fix (fixS * fixP,
if (!seg->use_rela_p)
{
bfd_vma insn;
- bfd_vma addend_abs = abs (value);
+ bfd_vma addend_abs = llabs (value);
/* Check that the absolute value of the addend can be
encoded in 12 bits. */
@@ -24587,7 +24587,7 @@ md_apply_fix (fixS * fixP,
if (!seg->use_rela_p)
{
bfd_vma insn;
- bfd_vma addend_abs = abs (value);
+ bfd_vma addend_abs = llabs (value);
/* Check that the absolute value of the addend can be
encoded in 8 bits. */
@@ -24627,7 +24627,7 @@ md_apply_fix (fixS * fixP,
if (!seg->use_rela_p)
{
bfd_vma insn;
- bfd_vma addend_abs = abs (value);
+ bfd_vma addend_abs = llabs (value);
/* Check that the absolute value of the addend is a multiple of
four and, when divided by four, fits in 8 bits. */
diff --git a/gas/config/tc-csky.c b/gas/config/tc-csky.c
index 550de10..75ced2a 100644
--- a/gas/config/tc-csky.c
+++ b/gas/config/tc-csky.c
@@ -5494,7 +5494,7 @@ get_macro_reg_vals (int *reg1, int *reg2, int *reg3)
s += nlen;
if (*s != '\0')
{
- csky_show_error (ERROR_BAD_END, 0, NULL, NULL);
+ csky_show_error (ERROR_BAD_END, 0, s, NULL);
return FALSE;
}
if (*reg1 == -1 || *reg2 == -1 || *reg3 == -1)