aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2021-06-15 08:00:17 +0200
committerJan Beulich <jbeulich@suse.com>2021-06-15 08:00:17 +0200
commit649658972ca923250019ca15e4ddd98bf28bf123 (patch)
treebc9be5d01b7e506c526ba335b8b6d9e0d045c3ca /gas/config
parenta50187b2c6c28be79a32332e06a572cf08683de3 (diff)
downloadgdb-649658972ca923250019ca15e4ddd98bf28bf123.zip
gdb-649658972ca923250019ca15e4ddd98bf28bf123.tar.gz
gdb-649658972ca923250019ca15e4ddd98bf28bf123.tar.bz2
x86: slightly simplify offset_in_range()
Applying a mask with all bits set (or its inverse, with hence all bits clear) won't alter the result (or won't trigger the warning). Re-arrange the code to eliminate two more of the somewhat odd (2 << width_minus_1) constructs.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index e6276dc..945a1a69 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -2556,10 +2556,10 @@ offset_in_range (offsetT val, int size)
{
case 1: mask = ((addressT) 1 << 8) - 1; break;
case 2: mask = ((addressT) 1 << 16) - 1; break;
- case 4: mask = ((addressT) 2 << 31) - 1; break;
#ifdef BFD64
- case 8: mask = ((addressT) 2 << 63) - 1; break;
+ case 4: mask = ((addressT) 1 << 32) - 1; break;
#endif
+ case sizeof (val): return val;
default: abort ();
}