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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Christoph Berg <myon(at)debian(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)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
Date: 2020-10-11 17:12:40
Message-ID: 3006140.1602436360@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Noah Misch <noah(at)leadboat(dot)com> 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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Christoph Berg 2020-10-11 18:35:13 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
Previous Message Michael Paquier 2020-10-11 10:15:32 pgsql: Use perfect hash for NFC and NFKC Unicode Normalization quick ch

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2020-10-11 17:52:55 Re: Possible NULL dereferencing null pointer (src/backend/executor/nodeIncrementalSort.c)
Previous Message Ranier Vilela 2020-10-11 10:39:07 Re: Possible NULL dereferencing null pointer (src/backend/executor/nodeIncrementalSort.c)