diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2016-08-11 09:14:45 +0100 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2016-08-11 09:14:45 +0100 |
commit | dbd8770c866ae978feb5ce9e71f64b9f7204d802 (patch) | |
tree | 79ab9ad767a5c837f37bcaf43417ee30a7317da1 /gas/config | |
parent | d93d1c80b351a424c1737436b5e7dfb44ddc9d46 (diff) | |
download | gdb-dbd8770c866ae978feb5ce9e71f64b9f7204d802.zip gdb-dbd8770c866ae978feb5ce9e71f64b9f7204d802.tar.gz gdb-dbd8770c866ae978feb5ce9e71f64b9f7204d802.tar.bz2 |
[AArch64] Reject -0.0 as an 8-bit FP immediate
parse_aarch64_imm_float was accepting -0.0 even though that's not
a valid immediate for any instruction. The FPIMM0 caller rejected
it, but the FPIMM one would silently treat it as -2.0.
This patch rejects -0.0 and adds testcases to illegal.[sd].
Before the patch, the final error emitted for illegal.s was:
Error: cannot do 16-byte relocation
which was matched by:
[^:]*:569: Error: .*
The error was reported against the last line of the file rather than
the instruction that required the reloc. Adding more instructions
meant that the line number also changed.
Reporting against the wrong line isn't good from a QoI perspective
but isn't what I'm trying to fix here. Until it's fixed, I thought
it would be better to adjust the match to be against an end-of-file
comment rather than against whatever the last instruction happens to be.
gas/
* config/tc-aarch64.c (parse_aarch64_imm_float): Reject -0.0.
* testsuite/gas/aarch64/illegal.s, testsuite/gas/aarch64/illegal.l:
Add tests for -0.0. Add an end-of-file comment.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-aarch64.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index e221ef4..34fdc53 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -2240,7 +2240,7 @@ parse_aarch64_imm_float (char **ccp, int *immed, bfd_boolean dp_p) } } - if (aarch64_imm_float_p (fpword) || (fpword & 0x7fffffff) == 0) + if (aarch64_imm_float_p (fpword) || fpword == 0) { *immed = fpword; *ccp = str; |