public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libffi: fix handling of homogeneous float128 structs [PR109447]
@ 2023-05-04 19:29 Peter Bergner
  2023-05-05 21:39 ` Peter Bergner
  2023-05-05 21:42 ` Jakub Jelinek
  0 siblings, 2 replies; 8+ messages in thread
From: Peter Bergner @ 2023-05-04 19:29 UTC (permalink / raw)
  To: GCC Patches; +Cc: Jakub Jelinek, Segher Boessenkool, Dan Horák

I'd like to pull in Dan's upstream libffi commit into trunk to fix a
wrong code bug/testsuite failure on powerpc64le-linux with long double
defaulting to ieee128.  This passed bootstrap and regtesting with no
regressions.  Ok for trunk?

This bug is also on the GCC 12 and GCC 11 release branches. Ok there too
assuming testing is clean?  I can wait to push the gcc12 backport until
after the release.

Peter


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.

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)


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-05-13 17:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-04 19:29 [PATCH] libffi: fix handling of homogeneous float128 structs [PR109447] Peter Bergner
2023-05-05 21:39 ` Peter Bergner
2023-05-05 21:42 ` Jakub Jelinek
2023-05-09 20:24   ` Peter Bergner
2023-05-09 20:50     ` Andreas Schwab
2023-05-09 21:20       ` Peter Bergner
2023-05-10  7:34         ` Andreas Schwab
2023-05-13 17:16           ` Peter Bergner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).