Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tzD8b-00Gib8-VC for pgsql-committers@arkaria.postgresql.org; Mon, 31 Mar 2025 11:17:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tzD8a-004LTG-Ja for pgsql-committers@arkaria.postgresql.org; Mon, 31 Mar 2025 11:17:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tzD8a-004LT6-Bn for pgsql-committers@lists.postgresql.org; Mon, 31 Mar 2025 11:17:04 +0000 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tzD8Y-0027mw-0N for pgsql-committers@lists.postgresql.org; Mon, 31 Mar 2025 11:17:03 +0000 Received: by mail-lf1-x143.google.com with SMTP id 2adb3069b0e04-54298ec925bso6680602e87.3 for ; Mon, 31 Mar 2025 04:17:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743419820; x=1744024620; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xomaAp4QURKJakJ09s7VBNeexsULmAT7u12fmTw994c=; b=Zi6XP0z88vPOH+FcwHEtE5rByNqdXK6rHwtdCjnyTMkcMicUI1UgORWZiu6u0U3fpW Gn6X7YIpBjc8b4pzgr9s66PcmXnr8xAmjwo41azFeMX9rG5ZVrjdHJ9Bc4A/uDBPJODi tcxXx9SFc0HSekru+Ae7AwMVZwZMGhRt9YZn5TLBEPxeu1WgSpJLr9xvd6fsEK+GyYcm j4ihzP7NwuLnOSn+l8yj9LIrJ+Cxrsj+f4Sr4eTAoipm0hSVHkKvN5qCwfLOMbL03nts ae+S1ZeMhlgJ2cAvxWdv3rKU2UXUaxlxI75ANJ+UM/+2irSVefdFqNpdjGU1tKMfVNyp fdpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743419820; x=1744024620; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xomaAp4QURKJakJ09s7VBNeexsULmAT7u12fmTw994c=; b=Wrw6TyAvJhJMSfbgKGM8L0u6L1y6INdeHjHNW5UlvfbPDNZGpmI259iCFFxfA2cZbT VWSXD53jAyROk1Ul1B+KNeoyBeDgrNIEePz+llUocUkPEevTRTOnb3gu39wDhjMp7UMj diYavHdHCWVLgVKRGWKNcrlSz5bernaR9msafJ4O38Lzvcy+pnA56kAIA6B+XQhrMs2d +/gpobG98R97pACq1xUPA2NrCaa6WvGD3QrJXB5+gXPM5Oflp9X3s8xX6VZQDe/CA8lZ we2vdvmoRKNOP/Y35rYVGzSI1sBE0Q6NqwbrzShzBjgiE/6lOhTENVUIpTWC+D4jiNCj AzRA== X-Gm-Message-State: AOJu0YxoJjTZUasq9l66FWjMlQb7rh6BBfv9v1Gej/L+vg5s9qrMf4j+ fTfCMYIE+4DVUPfzVQ7I9H5TVn/bcMBRFiMImHvKV+p9fqhKaE6wu262mHSdxdqAn7AgCea2SC5 5EAlrKSQFHP/wt9eJhRIi+61Gb3M= X-Gm-Gg: ASbGncvR3JbCCSjOgLEQBNtAz5JRKxpLtx+/Sl8pEx8Po45PGzJBAf02hVnRcnLD9HA 476G6+Z/LdAZQjDIQuRIqUCzZ7Vma9ku0TjiFaqcHwUcjTHHn3fHlXQSM1a9Z37ApkGV3w2nzgz GDsy+Pq9aun10fJXRHVn8UqMJ68ypxUvSothPUKA== X-Google-Smtp-Source: AGHT+IHMuG+8jILQYJKK88UfeC8iuH86VHfYpP5qi5NCE9OKKACFItjimcOq9epqylTOmtvTDy2MddwWJq9vLxiJTZU= X-Received: by 2002:a05:6512:e9c:b0:54a:d68f:6ecc with SMTP id 2adb3069b0e04-54b10db7de4mr2275538e87.2.1743419820253; Mon, 31 Mar 2025 04:17:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: John Naylor Date: Mon, 31 Mar 2025 18:16:47 +0700 X-Gm-Features: AQ5f1JqXlM6wEOX_yqbSCDwu1fzwzsi_2NEU7pprLbKcZUiWr87GcmWe4tb3ncc Message-ID: Subject: Re: pgsql: Inline CRC computation for small fixed-length input on x86 To: John Naylor Cc: pgsql-committers@lists.postgresql.org, cookt@blackduck.com Content-Type: multipart/mixed; boundary="00000000000014ccc30631a18f8a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000014ccc30631a18f8a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 31, 2025 at 3:07=E2=80=AFPM John Naylor wrote: > > On Mon, Mar 31, 2025 at 2:18=E2=80=AFPM John Naylor wrote: > > > Hmm, skimmer doesn't like this, and it's one of the animals that > > builds with -msse4.2: > > > > https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=3Dskimmer= &dt=3D2025-03-31%2007%3A00%3A27&stg=3Dconfigure > > > > "checking which CRC-32C implementation to use... SSE 4.2" > > > > I'm now looking for clues as to what could be causing the build failur= e. > > Looking at the configure output, I don't see -msee4.2 (or equivalent), > so it shouldn't be reporting that it's targeting SSE 4.2. Another clue: A few RHEL 9 x86_64 machines have reported in (webworm, shikra) with successful builds, and they also report targeting SSE 4.2 and also don't have special CFLAG's. We do know RHEL 9 has a policy of always targeting x86_64-v2, and it seems that they don't require user/packager intervention to achieve that, so I imagine their packaged compiler always defines __SSE4_2__ etc. 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 found these old gcc bug reports for a similar symptom when using LTO: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D71991 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D84926 ...so one theory is that the OS's with failing builds have let a similar bug back in. A possible workaround would be add a normally-superfluous "pg_attribute_target("sse4.2")" to the inlined function, as in the attached. -- John Naylor Amazon Web Services --00000000000014ccc30631a18f8a Content-Type: text/x-patch; charset="US-ASCII"; name="v1-workaround-possible-lto-gcc-bug.patch" Content-Disposition: attachment; filename="v1-workaround-possible-lto-gcc-bug.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_m8wywk6y0 ZGlmZiAtLWdpdCBhL3NyYy9pbmNsdWRlL3BvcnQvcGdfY3JjMzJjLmggYi9zcmMvaW5jbHVkZS9w b3J0L3BnX2NyYzMyYy5oCmluZGV4IDBhYjc1MTNmNTIzLi5iNDE5ODk3NWZhNiAxMDA2NDQKLS0t IGEvc3JjL2luY2x1ZGUvcG9ydC9wZ19jcmMzMmMuaAorKysgYi9zcmMvaW5jbHVkZS9wb3J0L3Bn X2NyYzMyYy5oCkBAIC01Myw2ICs1Myw3IEBAIHR5cGVkZWYgdWludDMyIHBnX2NyYzMyYzsKIGV4 dGVybiBwZ19jcmMzMmMgcGdfY29tcF9jcmMzMmNfc3NlNDIocGdfY3JjMzJjIGNyYywgY29uc3Qg dm9pZCAqZGF0YSwgc2l6ZV90IGxlbik7CiAKIHBnX2F0dHJpYnV0ZV9ub19zYW5pdGl6ZV9hbGln bm1lbnQoKQorcGdfYXR0cmlidXRlX3RhcmdldCgic3NlNC4yIikKIHN0YXRpYyBpbmxpbmUKIHBn X2NyYzMyYwogcGdfY29tcF9jcmMzMmNfZGlzcGF0Y2gocGdfY3JjMzJjIGNyYywgY29uc3Qgdm9p ZCAqZGF0YSwgc2l6ZV90IGxlbikK --00000000000014ccc30631a18f8a--