Re: Invalid control file checksum with AVX-512 during initdb on a clang19 -O0 build - Mailing list pgsql-bugs

From John Naylor
Subject Re: Invalid control file checksum with AVX-512 during initdb on a clang19 -O0 build
Date
Msg-id CANWCAZa9Q4_NcGn5CUHwEvBCN=nZz1_BFfeJEXXon05E_tYi7w@mail.gmail.com
Whole thread Raw
In response to Re: Invalid control file checksum with AVX-512 during initdb on a clang19 -O0 build  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: Invalid control file checksum with AVX-512 during initdb on a clang19 -O0 build
List pgsql-bugs
On Thu, Jun 12, 2025 at 4:42 AM Nathan Bossart <nathandbossart@gmail.com> wrote:
>
> (I've CC'd the committer of the feature.)
>
> On Wed, Jun 11, 2025 at 11:10:31AM -0700, Soumyadeep Chakraborty wrote:
> > Note that this only reproduces with clang-19 -O0 and NOT -O3. I haven't
> > tried with other versions of clang.
> >
> > OTOH, gcc-14 is cool with both -O0 and -O3, with AVX-512 getting picked
> > for both cases, for CRC instructions.
>
> I'm wondering if there's anything else this could be besides a compiler
> bug.  It's interesting that -O0 is the broken case.  Have you tried looking
> for differences in the assembly code?

Hmm, clang at -O0 is the same in versions 18, 19, and 20. The change
from v17 is easy enough to workaround as in the attached, which
produces identical output as master at -O2. Does this fix it for you?
If that's not it, it may be more difficult, as the change at -O0 from
v16 to v17 is large, so it's hard to see what's going on.

--
John Naylor
Amazon Web Services

Attachment

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #18947: TRAP: failed Assert("len_to_wrt >= 0") in pg_stat_statements
Next
From: PG Bug reporting form
Date:
Subject: BUG #18956: Observing an issue in regexp_count()