summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Horák <dan@danny.cz>2023-05-03 14:29:09 -0500
committerPeter Bergner <bergner@linux.ibm.com>2023-05-09 15:57:50 -0400
commit0069ce6631880776a44fb8408c6428c0812285cf (patch)
treece4fddcd2e4cf452848dee14f5b7f6364075a052
parent56da68414b5b5f0124cac29756c88710e5752762 (diff)
downloadgcc-0069ce6631880776a44fb8408c6428c0812285cf.tar.gz
libffi: fix handling of homogeneous float128 structs (#689)
If there is a homogeneous struct with float128 members, they should be copied to vector register save area. The current code incorrectly copies only the value of the first member, not increasing the pointer with each iteration. Fix this. Merged from upstream libffi commit: 464b4b66e3cf3b5489e730c1466ee1bf825560e0 2023-05-03 Dan Horák <dan@danny.cz> libffi/ PR libffi/109447 * src/powerpc/ffi_linux64.c (ffi_prep_args64): Update arg.f128 pointer. (cherry picked from commit 043550bceea7881163bba5d8a0486bb100a05809)
-rw-r--r--libffi/src/powerpc/ffi_linux64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libffi/src/powerpc/ffi_linux64.c b/libffi/src/powerpc/ffi_linux64.c
index 4d50878e402..3454dacd3d6 100644
--- a/libffi/src/powerpc/ffi_linux64.c
+++ b/libffi/src/powerpc/ffi_linux64.c
@@ -680,7 +680,7 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
{
if (vecarg_count < NUM_VEC_ARG_REGISTERS64
&& i < nfixedargs)
- memcpy (vec_base.f128++, arg.f128, sizeof (float128));
+ memcpy (vec_base.f128++, arg.f128++, sizeof (float128));
else
memcpy (next_arg.f128, arg.f128++, sizeof (float128));
if (++next_arg.f128 == gpr_end.f128)