From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | John Naylor <johncnaylorls(at)gmail(dot)com> |
Cc: | Andres Freund <andres(at)anarazel(dot)de>, pgsql-committers(at)lists(dot)postgresql(dot)org, cookt(at)blackduck(dot)com |
Subject: | Re: pgsql: Inline CRC computation for small fixed-length input on x86 |
Date: | 2025-03-31 12:12:55 |
Message-ID: | 3837990.1743423175@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
John Naylor <johncnaylorls(at)gmail(dot)com> writes:
> The two problem systems are CentOS stream 9 (apparently using LTO),
> and Rocky Linux 9 (still awaiting details). Both of these are supposed
> to be like RHEL 9.
I have reproduced it on a genuine-Red-Hat RHEL 9 x86_64 machine,
but only when compiling with --with-llvm, and the error goes away
if I select CC=clang. Furthermore, configure reports
checking which CRC-32C implementation to use... SSE 4.2
with CC=gcc but it says
checking which CRC-32C implementation to use... SSE 4.2 with runtime check
with CC=clang. Furthermore, the failure doesn't occur when gcc
compiles a file, but it does occur when clang compiles the same
file to produce a .bc file:
[transam]$ make twophase.o
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2 -I../../../../src/include -D_GNU_SOURCE -c -o twophase.o twophase.c
[transam]$ make twophase.bc
/usr/lib64/ccache/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-format-truncation -O2 -I../../../../src/include -D_GNU_SOURCE -flto=thin -emit-llvm -c -o twophase.bc twophase.c
In file included from twophase.c:79:
In file included from ../../../../src/include/access/commit_ts.h:16:
In file included from ../../../../src/include/replication/origin.h:15:
In file included from ../../../../src/include/access/xlogreader.h:41:
In file included from ../../../../src/include/access/xlogrecord.h:16:
../../../../src/include/port/pg_crc32c.h:70:10: error: always_inline function '_mm_crc32_u64' requires target feature 'crc32', but would be inlined into function 'pg_comp_crc32c_dispatch' that is compiled without support for 'crc32'
70 | crc = _mm_crc32_u64(crc, *(const uint64 *) p);
| ^
../../../../src/include/port/pg_crc32c.h:73:10: error: always_inline function '_mm_crc32_u32' requires target feature 'crc32', but would be inlined into function 'pg_comp_crc32c_dispatch' that is compiled without support for 'crc32'
73 | crc = _mm_crc32_u32(crc, *(const uint32 *) p);
| ^
../../../../src/include/port/pg_crc32c.h:75:10: error: always_inline function '_mm_crc32_u8' requires target feature 'crc32', but would be inlined into function 'pg_comp_crc32c_dispatch' that is compiled without support for 'crc32'
75 | crc = _mm_crc32_u8(crc, *p++);
| ^
3 errors generated.
make: *** [../../../../src/Makefile.global:1097: twophase.bc] Error 1
What I conclude is that Red Hat hot-wired gcc to assume -msse4.2,
but they didn't hot-wire clang the same way.
This seems kind of problematic for us. Quite aside from the build
failure, doesn't it mean that the .bc files are not very
representative of what is in the .o files?
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2025-03-31 12:52:23 | Re: pgsql: Inline CRC computation for small fixed-length input on x86 |
Previous Message | John Naylor | 2025-03-31 11:16:47 | Re: pgsql: Inline CRC computation for small fixed-length input on x86 |