Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kReu1-0006ti-6D for pgsql-hackers@arkaria.postgresql.org; Sun, 11 Oct 2020 17:12:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kRety-0001wh-3W for pgsql-hackers@arkaria.postgresql.org; Sun, 11 Oct 2020 17:12:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kRetx-0001wa-Sm for pgsql-hackers@lists.postgresql.org; Sun, 11 Oct 2020 17:12:53 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kRetu-0008BV-N1 for pgsql-hackers@lists.postgresql.org; Sun, 11 Oct 2020 17:12:53 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 09BHCetY3006141; Sun, 11 Oct 2020 13:12:41 -0400 From: Tom Lane To: Noah Misch cc: Christoph Berg , pgsql-hackers@lists.postgresql.org Subject: Re: powerpc pg_atomic_compare_exchange_u32_impl: error: comparison of integer expressions of different signedness (Re: pgsql: For all ppc compilers, implement compare_exchange and) fetch_add In-reply-to: <20201011051043.GA1724101@rfd.leadboat.com> References: <20201009092825.GD889580@msg.df7cb.de> <20201009100117.GA1550390@rfd.leadboat.com> <20201011051043.GA1724101@rfd.leadboat.com> Comments: In-reply-to Noah Misch message dated "Sat, 10 Oct 2020 22:10:43 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3006139.1602436360.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 11 Oct 2020 13:12:40 -0400 Message-ID: <3006140.1602436360@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Noah Misch writes: > The first attachment fixes the matter you've reported. While confirming= that, > I observed that gcc builds don't even use the 64-bit code in arch-ppc.h. > Oops. The second attachment fixes that. I reviewed these, and tested the first one on a nearby Apple machine. (I lack access to 64-bit PPC, so I can't actually test the second.) They look fine, and I confirmed by examining asm output that even the rather-old-now gcc version that Apple last shipped for PPC does the right thing with the conditionals. > I plan not to back-patch either of these. Hmm, I'd argue for a back-patch. The issue of modern compilers warning about the incorrect code will apply to all supported branches. Moreover, even if we don't use these code paths today, who's to say that someone won't back-patch a bug fix that requires them? I do not think it's unreasonable to expect these functions to work well in all branches that have them. regards, tom lane