From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id BAD6238F2450 for ; Fri, 21 Oct 2022 21:52:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BAD6238F2450 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666389149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HSJuwGwyHu2BBYhgM3HQlRx/06VRfZBgUTQkqoI4T5Y=; b=eqpg2sYv5Ro2IYBDyTc2aewS3LpbjCcWb72Qxew+So7so0fsYHFzpYD81e/sSAsyAvUCYk OiTmtECU9l9ylAa/Bl6FKhzAR8ApUTiAO9/bTUw/zAzQaM8BCTgtgGSnlsZQID9g3/hqO3 HWY4FJxhN6he3Q1qGkBPAzbdpjEEwBc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-441-xOhMCnXnOB2JYSkahCANiw-1; Fri, 21 Oct 2022 17:52:26 -0400 X-MC-Unique: xOhMCnXnOB2JYSkahCANiw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CCD1E832D39; Fri, 21 Oct 2022 21:52:25 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CAEC84A9257; Fri, 21 Oct 2022 21:52:24 +0000 (UTC) From: Florian Weimer To: Joseph Myers Cc: Jakub Jelinek , Subject: Re: C89isms in the test suite References: <87wn8tbmdr.fsf@oldenburg.str.redhat.com> <87o7u5bknf.fsf@oldenburg.str.redhat.com> <87k04tbim9.fsf@oldenburg.str.redhat.com> Date: Fri, 21 Oct 2022 23:52:22 +0200 In-Reply-To: (Joseph Myers's message of "Fri, 21 Oct 2022 21:00:03 +0000") Message-ID: <87a65o7skp.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Joseph Myers: > On Fri, 21 Oct 2022, Florian Weimer via Gcc wrote: > >> Is this really possible? For function pointers, it's an ABI change. >> int (*) () and int (*) (void) have different calling conventions on some >> ABIs (e.g., powerpc64le-linux-gnu). The ABI difference goes away once >> the callees are rebuilt, and I think such rebuilt callees are compatible >> with either calling convention. > > The semantics of int (*) (void) are a refinement of those of pre-C2x > int (*) (): any non-variadic function whose argument types are unchanged > by the default argument promotions can be called through an int (*) () > pointer, but only functions with no arguments can be called through an > int (*) (void) pointer. Pre-C2x powerpc64le-linux-gnu, a call through int (*) () with no arguments still sets up a parameter save area, while a call through int (*) (void) does not. With C2x, neither will set up a parameter save area. Hopefully, the current rs6000 backend already uses the parameter save area just for, well, saving parameters, and not for general-purpose spilling. In this case, there won't be any ABI problems from the C2x change for powerpc64le. (Sorry that I keep bringing this up, it's confusing to me, and I once spent quite some time tracking down a stack corruption because glibc's open implementation assumed a parameter save area that the caller did not provide.) Thanks, Florian