aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorLoria <Loria@phantasia.org>2016-02-01 14:32:25 +0000
committerNick Clifton <nickc@redhat.com>2016-02-01 14:32:25 +0000
commit4f1d62057fa4894e504458027ac3228404144f7d (patch)
treedf32667e5e3c487bc696920ab9a4a182df7b8a1b /gas/config
parent655ed9ea1703173cb796070ed9843ea90bb74e58 (diff)
downloadgdb-4f1d62057fa4894e504458027ac3228404144f7d.zip
gdb-4f1d62057fa4894e504458027ac3228404144f7d.tar.gz
gdb-4f1d62057fa4894e504458027ac3228404144f7d.tar.bz2
Fix a problem building the ARM assembler using LLVM.
PR target/19311 * config/tc-arm.c (encode_arm_immediate): Recode to improve efficiency and avoid an LLVM loop optimization bug.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-arm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 4a16267..055e525 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -7268,7 +7268,10 @@ encode_arm_immediate (unsigned int val)
{
unsigned int a, i;
- for (i = 0; i < 32; i += 2)
+ if (val <= 0xff)
+ return val;
+
+ for (i = 2; i < 32; i += 2)
if ((a = rotate_left (val, i)) <= 0xff)
return a | (i << 7); /* 12-bit pack: [shift-cnt,const]. */