On Thu, May 04, 2023 at 02:29:34PM -0500, Peter Bergner wrote: > 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 <d...@danny.cz> > > libffi/ > PR libffi/109447 > * src/powerpc/ffi_linux64.c (ffi_prep_args64): Update arg.f128 pointer.
Ok for 14/13.2/12.4 (i.e. after 12.3 is out)/11.4 > 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) Jakub