From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by sourceware.org (Postfix) with ESMTPS id 176A83858C83 for ; Mon, 27 Mar 2023 14:45:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 176A83858C83 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1679928311; bh=Mt+4Gg6FOHGVhT3ffDo3MEixYFvnl4RgGE5THweXw1U=; h=Subject:From:To:Cc:In-Reply-To:References:Date:From; b=Cq5/82jlpK3kSYfjVH4a+3nNHr1cGARQFIll5OjNdGlzUC+jRoHA1b5+p+c5e/63j Fon503Tdx7AXyGbIBl28q/Tmfe2e47z/UcrGrvAVuR8KEYD2lf5dT9UwwxT+ahSPsn SVKGYA/YbUWfHKB3L6BILKf0qQljup6stbiRqAXs= Received: from localhost.localdomain (xry111.site [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 067FB65C75; Mon, 27 Mar 2023 10:45:08 -0400 (EDT) Message-ID: <3213761c98e90d932973f5201efbd84556844042.camel@xry111.site> Subject: Re: [PATCH v2 0/5] linux: Avoid va_list for generic syscall wrappers if possible From: Xi Ruoyao To: Carlos O'Donell , libc-alpha@sourceware.org Cc: caiyinyu , Wang Xuerui , Adhemerval Zanella Netto , Andreas Schwab , Florian Weimer In-Reply-To: <98295b42-c079-c32c-31d6-bb45013342ee@redhat.com> References: <20230325140815.4170296-1-xry111@xry111.site> <98295b42-c079-c32c-31d6-bb45013342ee@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Mon, 27 Mar 2023 22:44:48 +0800 User-Agent: Evolution 3.48.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,LIKELY_SPAM_FROM,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, 2023-03-27 at 10:04 -0400, Carlos O'Donell wrote: > In summary, I think this is a compiler problem Definitely true. > and that working around this in glibc > is going to result in: >=20 > - Odd corner case ABI issues between public declarations of variadic func= tions and > =C2=A0 internal non-variadic definitions. >=20 > - Poorer testing of #else code that uses variadic arguments, as the publi= c interface > =C2=A0 requires. >=20 > I don't support going in this direction. Valid reasons. Abandon this series then. But I hope these could be raised earlier (in the discussion about LoongArch syscall.S) so I wouldn't write all the code :). > Is there an alternative that could generate better code that doesn't go t= his way? For LoongArch I can improve GCC to save only the GARs containing the arguments really used in va_arg (i.e. one GAR for things like open() or fcntl() instead of all 8 GARs), but I guess the patch will be delayed into GCC 14. Generally I've not got an idea about how to make GCC avoid saving GARs unnecessarily with va_arg. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University