GCC 11.1.0 build for mingw-w64 is broken now. Up to 10.3.0 the following was used in gcc/config/i386/ia32intrin.h: extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __rdtsc (void) { return __builtin_ia32_rdtsc (); } extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __rdtscp (unsigned int *__A) { return __builtin_ia32_rdtscp (__A); } but now we have just #define __rdtsc() __builtin_ia32_rdtsc () #define __rdtscp(a) __builtin_ia32_rdtscp (a) Changing this back fixes the build. See also mingw-w64 7.0.0 at mingw-w64-crt/intrincs/rdtsc.c.
CC author.
To me this looks like a bug in mingw-w64-crt rather than a bug in GCC. A simple fix to the mingw-w64-crt sources is just do: unsigned __int64 (__rdtsc)(void)
What is in mingw-w64-crt/intrincs/rdtsc.c?
Created attachment 50772 [details] rdtsc.c Please find attached the mingw-w64 file.
(In reply to Daniel Starke from comment #4) > Created attachment 50772 [details] > rdtsc.c > > Please find attached the mingw-w64 file. Please change #if !__has_builtin(__rdtsc) to #if !__has_builtin(__rdtsc) && !defined __rdtsc
Thank you for the suggestion, however, I am not involved in the mingw-w64 project. Furthermore, the fact that this regression remains against all versions of mingw-w64 known to date does not change. It is also unclear to me why only these two intrinsics are handled differently now. What was the purpose of this change? Do we break existing code if the change is reverted?
(In reply to Daniel Starke from comment #6) > Thank you for the suggestion, however, I am not involved in the mingw-w64 > project. Furthermore, the fact that this regression remains against all > versions of mingw-w64 known to date does not change. It doesn't make what mingw-w64 did is correct. > It is also unclear to me why only these two intrinsics are handled > differently now. What was the purpose of this change? Do we break existing > code if the change is reverted? See PR target/99744.
This bug was fixes in mingw-w64. The bug fix is included since versions 8.0.1. See https://sourceforge.net/p/mingw-w64/mailman/mingw-w64-public/thread/bb03f15f-db70-a511-a10d-396fbd8cf3c1%40126.com/#msg37259429 The bug report here can be closed.
It was already closed a year ago.