Message ID | f3381264-616a-6c76-3357-7dec1f60696d@linux.ibm.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:3046:b0:115:7a1d:dabb with SMTP id p6csp525889rwl; Thu, 4 May 2023 12:30:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Q4SVH1EVRfrj1Tqz7ZH5OaUh8in4GdtqxEawU6IOibkS6h8A4EXNbMJZII0o5eYr182sI X-Received: by 2002:a17:907:9694:b0:961:272d:bdb8 with SMTP id hd20-20020a170907969400b00961272dbdb8mr7925644ejc.73.1683228627587; Thu, 04 May 2023 12:30:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683228627; cv=none; d=google.com; s=arc-20160816; b=Gl2R4Dffd0UqDW1ZAuylfO4gZZwbqdDa4CSrF4qRvaWCDJAy0NODHzLHfbtosRS2wz 3lBbLl7eAk6EL41OyolLhN29uCqnRYdMvHiFKloxtDzmlIxD4dEfj7EWMOqZ7K98AcuO CP0cMmIqAdGaNQzYbqpHaXmdXxa5tQWywF72WHT2K4LGai+UMhvETVBPfBktfhyuWIJY T1Nd43nayFpFgpMg/YnFZmLLOHFuIli7rJxQRsQaCcF8afFF6uCE30B97KC0gzkbxSql 4mUezCVed5feaSvD/K945he2ndh4kPgggIRpuQi+IcbxLpExUOcDt3Z5X0k6xCrto/3j PopQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:subject:cc:to:content-language:user-agent :mime-version:date:message-id:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=0sRScSFBW/m8Wk7OwXVXHIr9dNdkHZVHg/lQl7s3XUY=; b=FTjPv1VDpIg4IX/w7RKFRSAJigC9NPrsYTDun7IKhB2ikutg9sdHyUlA0D0EFo7fK1 ixp9kcT6ECouwnEsFi/FxfDnR840k+4NkHskfAShFKm52ZgYBjtuxJO7WBufABWXGft9 IhdemYgv7/erx7VT4akNr1lx2rTwk/NVzv2ZeHnUx1wx+zrtFl1xhnSrjKHClYUdYanH Q1YIuZ+m9g83lKjyZtAGCuM1j4iOVVPa3Ouh9dnfvH+eC9at0HwYViKZgzyy9wYaYs/y kbSr70oX8T2NyUHRXzuhLJfJUf/z5iQoAQBcIG0ak+s56c/P1VRrTU3TqJBZIhl4SdMm NuEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Rjvp72Mz; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id p20-20020a170906229400b0094ef17510d6si19995936eja.862.2023.05.04.12.30.27 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 12:30:27 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Rjvp72Mz; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 194FA3858C20 for <ouuuleilei@gmail.com>; Thu, 4 May 2023 19:30:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 194FA3858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683228626; bh=0sRScSFBW/m8Wk7OwXVXHIr9dNdkHZVHg/lQl7s3XUY=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Rjvp72MzQFI7optEBgbe9Iu5RmsFj9bYoD9oHc6ILBx1WWgIvKXTcB0jK8mFgMfSZ w5kePK71w5gcc6Rlzo8glZPbkmWHZywkt/IzIzb8EHqcYJaGj5SYnTXlUHrOaktnnE idfSJYvA+3J7y4KcuE2/OJGNyRS1y1X4MuckmHAU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 15D083858D33 for <gcc-patches@gcc.gnu.org>; Thu, 4 May 2023 19:29:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 15D083858D33 Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 344JBZa8013697; Thu, 4 May 2023 19:29:38 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qcfpxf825-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 May 2023 19:29:38 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 344JRKOP020004; Thu, 4 May 2023 19:29:37 GMT Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qcfpxf81g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 May 2023 19:29:37 +0000 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 344G3s1X002049; Thu, 4 May 2023 19:29:36 GMT Received: from smtprelay04.dal12v.mail.ibm.com ([9.208.130.102]) by ppma05wdc.us.ibm.com (PPS) with ESMTPS id 3q8tv8345g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 May 2023 19:29:36 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay04.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 344JTZcQ31719820 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 4 May 2023 19:29:36 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E1F7758057; Thu, 4 May 2023 19:29:35 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7FEA158058; Thu, 4 May 2023 19:29:35 +0000 (GMT) Received: from [9.61.83.151] (unknown [9.61.83.151]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 4 May 2023 19:29:35 +0000 (GMT) Message-ID: <f3381264-616a-6c76-3357-7dec1f60696d@linux.ibm.com> Date: Thu, 4 May 2023 14:29:34 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Content-Language: en-US To: GCC Patches <gcc-patches@gcc.gnu.org> Cc: Jakub Jelinek <jakub@redhat.com>, Segher Boessenkool <segher@kernel.crashing.org>, =?utf-8?q?Dan_Hor=C3=A1k?= <dan@danny.cz> Subject: [PATCH] libffi: fix handling of homogeneous float128 structs [PR109447] Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: LqFqVCiPptZzG35oNoS4cQarY9agtsMW X-Proofpoint-GUID: pKtiSbqt4_2lRRbtZGqpewgCoFoXL6S4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-04_13,2023-05-04_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 mlxlogscore=999 impostorscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 clxscore=1011 suspectscore=0 priorityscore=1501 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305040153 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Peter Bergner via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Peter Bergner <bergner@linux.ibm.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764993141455198914?= X-GMAIL-MSGID: =?utf-8?q?1764993141455198914?= |
Series |
libffi: fix handling of homogeneous float128 structs [PR109447]
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Peter Bergner
May 4, 2023, 7:29 p.m. UTC
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.
Comments
On 5/4/23 2:29 PM, 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. Oops, and of course, this needs to be backported to GCC 13 as well. Peter
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 <dan@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
On 5/5/23 4:42 PM, Jakub Jelinek wrote: > On Thu, May 04, 2023 at 02:29:34PM -0500, Peter Bergner wrote: >> 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. > > Ok for 14/13.2/12.4 (i.e. after 12.3 is out)/11.4 Thanks, I've pushed the GCC trunk and GCC 13 commits and now that GCC 12.3 is released, I have pushed the GCC 12 backport too. I have yet to push to GCC 11 yet, due to bootstrap is broken when building GCC 11 on our Fedora 36 system, so I cannot test there yet. It also seems GCC 11 is missing some IEEE128 changes from upstream libffi that GCC 12 and later have, so it might not even be appropriate, but I'll wait for bootstrap to be restored before making any decisions. The problem seem to be that the system ld.gold which is used to link libgo.so is dying with an undefined runtime symbol: /usr/bin/ld.gold: /home/bergner/gcc/build/gcc-fsf-11-baselib-regtest/powerpc64le-linux/libstdc++-v3/src/.libs/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/bin/ld.gold) collect2: error: ld returned 1 exit status Running the link command by hand or via a make in powerpc64le-linux/libgo, the link succeeds. It's only when I type make in the top level build dir where I see this error. It's almost as if the top level build machinery adds a LD_LIBRARY_PATH=... forcing the system ld.gold (which was built with a gcc12 based compiler) to pick up the build's gcc11 libstdc++ which doesn't have that symbol, rather than the gcc12 system libstdc++. Has anyone seen anything like that before? Peter
On Mai 09 2023, Peter Bergner via Gcc-patches wrote: > It's almost as if the top level build machinery > adds a LD_LIBRARY_PATH=... See how the toplevel Makefile sets LD_LIBRARY_PATH (via RPATH_ENVVAR) if gcc-bootstrap is set.
On 5/9/23 3:50 PM, Andreas Schwab wrote: > On Mai 09 2023, Peter Bergner via Gcc-patches wrote: > >> It's almost as if the top level build machinery >> adds a LD_LIBRARY_PATH=... > > See how the toplevel Makefile sets LD_LIBRARY_PATH (via RPATH_ENVVAR) if > gcc-bootstrap is set. I'm sorry to be dense, but can you point to the specific line? In my $GCC_BUILD/Makefile, the only mention of LD_LIBRARY_PATH is: RPATH_ENVVAR = LD_LIBRARY_PATH ...so that isn't setting LD_LIBRARY_PATH, but using it. Peter
On Mai 09 2023, Peter Bergner via Gcc-patches wrote: > On 5/9/23 3:50 PM, Andreas Schwab wrote: >> On Mai 09 2023, Peter Bergner via Gcc-patches wrote: >> >>> It's almost as if the top level build machinery >>> adds a LD_LIBRARY_PATH=... >> >> See how the toplevel Makefile sets LD_LIBRARY_PATH (via RPATH_ENVVAR) if >> gcc-bootstrap is set. > > I'm sorry to be dense, but can you point to the specific line? In my > $GCC_BUILD/Makefile, the only mention of LD_LIBRARY_PATH is: > > RPATH_ENVVAR = LD_LIBRARY_PATH > > ...so that isn't setting LD_LIBRARY_PATH, but using it. Have you considered searching for uses of RPATH_ENVVAR? $ grep RPATH_ENVVAR Makefile.in RPATH_ENVVAR = @RPATH_ENVVAR@ # On targets where RPATH_ENVVAR is PATH, a subdirectory of the GCC build path $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ # This is the list of directories that may be needed in RPATH_ENVVAR # This is the list of directories that may be needed in RPATH_ENVVAR "RPATH_ENVVAR=$(RPATH_ENVVAR)" \
On 5/10/23 2:34 AM, Andreas Schwab wrote: > On Mai 09 2023, Peter Bergner via Gcc-patches wrote: >> I'm sorry to be dense, but can you point to the specific line? In my >> $GCC_BUILD/Makefile, the only mention of LD_LIBRARY_PATH is: >> >> RPATH_ENVVAR = LD_LIBRARY_PATH >> >> ...so that isn't setting LD_LIBRARY_PATH, but using it. > > Have you considered searching for uses of RPATH_ENVVAR? Ah, I misread that as RPATH_ENVVAR = $LD_LIBRARY_PATH and was expecting to see "export LD_LIBRARY_PATH=..." in the code. Thanks for the pointer! Peter
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)