diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-11-15 02:46:03 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-11-16 23:21:39 -0500 |
commit | 58a345fe1f0407cb2743da0b295ef28cc7f23c72 (patch) | |
tree | e0332020f5faca0ca9660880e0247c01a1859d28 /gas/config | |
parent | 7ffdbc4f3fe7aaa8862a9189bc625cbbb05ff9a4 (diff) | |
download | gdb-58a345fe1f0407cb2743da0b295ef28cc7f23c72.zip gdb-58a345fe1f0407cb2743da0b295ef28cc7f23c72.tar.gz gdb-58a345fe1f0407cb2743da0b295ef28cc7f23c72.tar.bz2 |
gas: microblaze: fix shift overflow
This code tries to shift an integer 31 bits which triggers a werror:
gas/config/tc-microblaze.c:742:21: error: integer overflow in expression [-Werror=overflow]
e->X_add_number |= -(1 << 31);
Cast the 1 to offsetT to match X_add_number to fix things.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-microblaze.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c index ac7c828..0ec24f8 100644 --- a/gas/config/tc-microblaze.c +++ b/gas/config/tc-microblaze.c @@ -739,7 +739,7 @@ parse_imm (char * s, expressionS * e, offsetT min, offsetT max) { /* Special case: sign extend negative 32-bit values to 64-bits. */ if ((e->X_add_number >> 31) == 1) - e->X_add_number |= -(1 << 31); + e->X_add_number |= -((offsetT) 1 << 31); if (e->X_add_number < min || e->X_add_number > max) { |