Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 687f616

Browse files
committed
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 697e1d0 and 913ec71 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
1 parent 7b94e99 commit 687f616

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/include/c.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,21 @@
200200
#define pg_noinline
201201
#endif
202202

203+
/*
204+
* For now, just define pg_attribute_cold and pg_attribute_hot to be empty
205+
* macros on minGW 8.1. There appears to be a compiler bug that results in
206+
* compilation failure. At this time, we still have at least one buildfarm
207+
* animal running that compiler, so this should make that green again. It's
208+
* likely this compiler is not popular enough to warrant keeping this code
209+
* around forever, so let's just remove it once the last buildfarm animal
210+
* upgrades.
211+
*/
212+
#if defined(__MINGW64__) && __GNUC__ == 8 && __GNUC_MINOR__ == 1
213+
214+
#define pg_attribute_cold
215+
#define pg_attribute_hot
216+
217+
#else
203218
/*
204219
* Marking certain functions as "hot" or "cold" can be useful to assist the
205220
* compiler in arranging the assembly code in a more efficient way.
@@ -216,6 +231,8 @@
216231
#define pg_attribute_hot
217232
#endif
218233

234+
#endif /* defined(__MINGW64__) && __GNUC__ == 8 &&
235+
* __GNUC_MINOR__ == 1 */
219236
/*
220237
* Mark a point as unreachable in a portable fashion. This should preferably
221238
* be something that the compiler understands, to aid code generation.

0 commit comments

Comments
 (0)