diff options
author | Bernhard Schommer <bschommer@users.noreply.github.com> | 2019-11-28 17:00:27 +0100 |
---|---|---|
committer | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2019-11-28 17:00:27 +0100 |
commit | a99406bbd9c01dc04e79b14681a254fe22c9d424 (patch) | |
tree | b7901f046fbf73617ff4a0f810830cabcd876fdd /aarch64/extractionMachdep.v | |
parent | 5dcd78a4382992e92955ec0614fc2f5c4f80c429 (diff) | |
download | compcert-a99406bbd9c01dc04e79b14681a254fe22c9d424.tar.gz compcert-a99406bbd9c01dc04e79b14681a254fe22c9d424.zip |
Fix for AArch64 alignment problem (#206)
In addressing modes for load and store instructions, the offset must be a multiple of the memory size being accessed. When accessing global variables, this may not be the case if the alignment of the variable is less than its size. Errors occur at link time.
This PR extends the check for a representable offset for the addressing of global
variables to also check whether the variable is correctly aligned. Only if both conditions are
met can we generate the short sequence Padrp / ADadr. Otherwise we go through the generic
loadsymbol sequence.
Diffstat (limited to 'aarch64/extractionMachdep.v')
-rw-r--r-- | aarch64/extractionMachdep.v | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/aarch64/extractionMachdep.v b/aarch64/extractionMachdep.v index a447d12f..e82056e2 100644 --- a/aarch64/extractionMachdep.v +++ b/aarch64/extractionMachdep.v @@ -21,3 +21,4 @@ Extract Constant Archi.pic_code => "fun () -> false". (* for the time being *) (* Asm *) Extract Constant Asm.symbol_low => "fun _ _ _ -> assert false". Extract Constant Asm.symbol_high => "fun _ _ _ -> assert false". +Extract Constant Asmgen.symbol_is_aligned => "C2C.atom_is_aligned". |