summaryrefslogtreecommitdiff
path: root/src/include/c.h
diff options
context:
space:
mode:
authorDavid Rowley2020-11-25 03:33:43 +0000
committerDavid Rowley2020-11-25 03:33:43 +0000
commit687f6163447514c23b44a981540987013529a9ec (patch)
tree4b0d49e46954c1653cc72c1f0ba2546a4f77d072 /src/include/c.h
parent7b94e999606e2e2e10d68d544d49fc5a5d5785ac (diff)
Stop gap fix for __attribute__((cold)) compiler bug in MinGW 8.1
The buildfarm animal walleye, running MinGW 8.1 has been having problems ever since 697e1d02f and 913ec71d6 went in. This appears to be a bug in assembler which was fixed in a later version. For now, in order to get that animal running green again, let's just define pg_attribute_cold and pg_attribute_hot to be empty macros on that compiler. Hopefully, we can get the support of the owner of the animal to upgrade to a less buggy compiler and revert this at a later date. Discussion: https://postgr.es/m/286560.1606233316@sss.pgh.pa.us
Diffstat (limited to 'src/include/c.h')
-rw-r--r--src/include/c.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/include/c.h b/src/include/c.h
index 3d047490078..b21e4074dd6 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -201,6 +201,21 @@
#endif
/*
+ * For now, just define pg_attribute_cold and pg_attribute_hot to be empty
+ * macros on minGW 8.1. There appears to be a compiler bug that results in
+ * compilation failure. At this time, we still have at least one buildfarm
+ * animal running that compiler, so this should make that green again. It's
+ * likely this compiler is not popular enough to warrant keeping this code
+ * around forever, so let's just remove it once the last buildfarm animal
+ * upgrades.
+ */
+#if defined(__MINGW64__) && __GNUC__ == 8 && __GNUC_MINOR__ == 1
+
+#define pg_attribute_cold
+#define pg_attribute_hot
+
+#else
+/*
* Marking certain functions as "hot" or "cold" can be useful to assist the
* compiler in arranging the assembly code in a more efficient way.
*/
@@ -216,6 +231,8 @@
#define pg_attribute_hot
#endif
+#endif /* defined(__MINGW64__) && __GNUC__ == 8 &&
+ * __GNUC_MINOR__ == 1 */
/*
* Mark a point as unreachable in a portable fashion. This should preferably
* be something that the compiler understands, to aid code generation.