Added missing alignment check to load/store uimm12 immediate offset.
authorYufeng Zhang <yufeng.zhang@arm.com>
Mon, 15 Oct 2012 14:52:06 +0000 (14:52 +0000)
committerYufeng Zhang <yufeng.zhang@arm.com>
Mon, 15 Oct 2012 14:52:06 +0000 (14:52 +0000)
opcodes/

* aarch64-opc.c (operand_general_constraint_met_p): Change to check
the alignment of addr.offset.imm instead of that of shifter.amount for
operand type AARCH64_OPND_ADDR_UIMM12.

gas/testsuite/

* gas/aarch64/illegal-2.s: Add test case.
* gas/aarch64/illegal-2.l: Likewise.

gas/testsuite/gas/aarch64/illegal-2.l
gas/testsuite/gas/aarch64/illegal-2.s
opcodes/aarch64-opc.c

index 2ba6894..372596b 100644 (file)
@@ -6,3 +6,4 @@
 [^:]*:16: Error: .*$
 [^:]*:19: Error: .*$
 [^:]*:20: Error: .*$
+[^:]*:24: Error: .*$
index 3aa7283..7711e14 100644 (file)
@@ -20,3 +20,5 @@
        mov     wsp, #0x33030000
 
 .set u16, 0xfff0
+
+       ldr     x0, [x0, #257]
index 2d66a25..8c70938 100644 (file)
@@ -1426,7 +1426,7 @@ operand_general_constraint_met_p (const aarch64_opnd_info *opnds, int idx,
                                             0, 4095 * size);
              return 0;
            }
-         if (!value_aligned_p (opnd->shifter.amount, size))
+         if (!value_aligned_p (opnd->addr.offset.imm, size))
            {
              set_unaligned_error (mismatch_detail, idx, size);
              return 0;