test failure with gcc-12 -O3 -march=native

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: test failure with gcc-12 -O3 -march=native
Date: 2022-08-11 20:03:43
Message-ID: 20220811200343.ir6evfqsead3syeq@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

For my optimized builds I've long used -O3 -march=native. After one of the
recent package updates (I'm not certain when exactly yet), the main regression
tests started to fail for me with that. Oddly enough in opr_sanity:

-- Ask access methods to validate opclasses
-- (this replaces a lot of SQL-level checks that used to be done in this file)
SELECT oid, opcname FROM pg_opclass WHERE NOT amvalidate(oid);
- oid | opcname
------+---------
-(0 rows)
+INFO: operator family "array_ops" of access method hash contains function hash_array_extended(anyarray,bigint) with wrong signature for support number 2
+INFO: operator family "bpchar_ops" of access method hash contains function hashbpcharextended(character,bigint) with wrong signature for support number 2
...
+ 16492 | part_test_int4_ops
+ 16497 | part_test_text_ops
+(43 rows)

Given that I did not encounter this problem with gcc-12 before, and that
gcc-12 has been released, it seems less likely to be a bug in our code
highlighted by a new optimization and more likely to be a bug in a gcc bugfix,
but it's definitely not clear.

I only investigated this a tiny bit so far. What fails is the
procform->prorettype != restype comparison in check_hash_func_signature().

Greetings,

Andres Freund

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2022-08-11 20:12:33 Re: Postgres NOT IN vs NOT EXISTS optimization
Previous Message David Rowley 2022-08-11 19:55:05 Re: avoid negating LONG_MIN in cash_out()