This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
GOLD aarch64 warning fix
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 22 Jul 2015 11:41:52 +0930
- Subject: GOLD aarch64 warning fix
- Authentication-results: sourceware.org; auth=none
Committed. Fixes the following gcc5 complaint.
aarch64.cc:2026:50: error: integer overflow in expression [-Werror=overflow]
Insntype adr_insn = adrp_insn & ((1 << 31) - 1);
* aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
diff --git a/gold/aarch64.cc b/gold/aarch64.cc
index 4153389..9f2ce74 100644
--- a/gold/aarch64.cc
+++ b/gold/aarch64.cc
@@ -2023,7 +2023,7 @@ AArch64_relobj<size, big_endian>::try_fix_erratum_843419_optimized(
if (-(1 << 20) <= adr_imm && adr_imm < (1 << 20))
{
// Convert 'adrp' into 'adr'.
- Insntype adr_insn = adrp_insn & ((1 << 31) - 1);
+ Insntype adr_insn = adrp_insn & ((1u << 31) - 1);
adr_insn = Insn_utilities::
aarch64_adr_encode_imm(adr_insn, adr_imm);
elfcpp::Swap<32, big_endian>::writeval(adrp_view, adr_insn);
--
Alan Modra
Australia Development Lab, IBM