diff options
author | Xavier Leroy <xavier.leroy@college-de-france.fr> | 2021-09-23 12:52:11 +0200 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@college-de-france.fr> | 2021-09-23 19:53:00 +0200 |
commit | c34d25e011402aedad62b3fe9b7b04989df4522e (patch) | |
tree | 22d326c5cf94caabfcec76553b98616bbf44b1a2 /powerpc | |
parent | c8ccecc783671fb699a33f432c34e3c1cd1dc801 (diff) | |
download | compcert-c34d25e011402aedad62b3fe9b7b04989df4522e.tar.gz compcert-c34d25e011402aedad62b3fe9b7b04989df4522e.zip |
Fix wrong expansion of __builtin_memcpy_aligned
In the "small" case, there was an error in the choice of temporary
registers to use when one argument is a stack location and the other
is a register. The chosen temporary could conflict with the argument
that resides in a register.
Fixes: #412
Diffstat (limited to 'powerpc')
-rw-r--r-- | powerpc/Asmexpand.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/powerpc/Asmexpand.ml b/powerpc/Asmexpand.ml index 7efa80a6..45b3f708 100644 --- a/powerpc/Asmexpand.ml +++ b/powerpc/Asmexpand.ml @@ -118,8 +118,8 @@ let memcpy_small_arg sz arg tmp = assert false let expand_builtin_memcpy_small sz al src dst = - let (tsrc, tdst) = - if dst <> BA (IR GPR11) then (GPR11, GPR12) else (GPR12, GPR11) in + let tsrc = if dst <> BA (IR GPR11) then GPR11 else GPR12 in + let tdst = if dst <> BA (IR GPR12) then GPR12 else GPR11 in let (rsrc, osrc) = memcpy_small_arg sz src tsrc in let (rdst, odst) = memcpy_small_arg sz dst tdst in let rec copy osrc odst sz = |