https://bugs.gentoo.org/960257
https://gcc.gnu.org/PR77472
--- a/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
+++ b/src/hotspot/share/utilities/globalDefinitions_gcc.hpp
@@ -170,7 +170,7 @@ inline int wcslen(const jchar* x) { return wcslen((const wchar_t*)x); }
 // Inlining support
 #define NOINLINE     __attribute__ ((noinline))
 #define ALWAYSINLINE inline __attribute__ ((always_inline))
-#define ATTRIBUTE_FLATTEN __attribute__ ((flatten))
+#define ATTRIBUTE_FLATTEN
 
 // Alignment
 //
