Re: Keep elog(ERROR) and ereport(ERROR) calls in the cold path
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: David Rowley <dgrowleyml@gmail.com>,
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
Andres Freund <andres@anarazel.de>,
PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2020-11-24T21:11:59Z
Lists: pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes: > On 2020-Nov-24, Tom Lane wrote: >> I'd make any such fix as narrow as possible (ie MINGW64 only, based on >> present evidence). It'd be nice to have a compiler version upper bound >> too, in the hopes that they'd fix it in future. Maybe something like >> "#if defined(__MINGW64__) && defined(__GNUC__) && __GNUC__ <= 8" ? > Apparently the bug was fixed days after it was reported, > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86048 > but they haven't made a release containing the fix yet. Ah, great sleuthing! So that says it occurs in 8.1 only, meaning the version test could be like #if defined(__MINGW64__) && __GNUC__ == 8 && __GNUC_MINOR__ == 1 // lobotomized code here #else ... It's not entirely clear from that bug report whether it can manifest on gcc 8.1 on other platforms; maybe we should test for x86 in general not __MINGW64__. regards, tom lane
Commits
-
Stop gap fix for __attribute__((cold)) compiler bug in MinGW 8.1
- 687f61634475 14.0 landed
-
Tidy up definitions of pg_attribute_hot and pg_attribute_cold
- b0727ae99b70 14.0 landed
-
Fix unportable usage of __has_attribute
- 1fa22a43a56e 14.0 landed
-
Improve compiler code layout in elog/ereport ERROR calls
- 913ec71d682e 14.0 landed
-
Define pg_attribute_cold and pg_attribute_hot macros
- 697e1d02f53f 14.0 landed