On Wed, 25 Nov 2020 at 14:35, David Rowley <dgrowle...@gmail.com> wrote: > > On Wed, 25 Nov 2020 at 14:28, Tom Lane <t...@sss.pgh.pa.us> wrote: > > So maybe, rather than hacking up the attribute stuff for > > a bug that might bite us again anyway in future, we ought > > to press walleye's owner to install a more recent compiler. > > I think that seems like a better idea. I had thoughts about > installing a quick for now to give the owner of walleye a bit of time > for the upgrade. From what I can tell, the latest version of minGW > comes with GCC 9.2 [1]
So, how about the attached today and I'll email Joseph about walleye and see if he can upgrade to a newer minGW version. David
diff --git a/src/include/c.h b/src/include/c.h index 3d04749007..4257300601 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -200,6 +200,21 @@ #define pg_noinline #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,7 @@ #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.