f6bfab
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c
f6bfab
index 2aeabd2..8b285bb 100644
f6bfab
--- a/Cython/Utility/ModuleSetupCode.c
f6bfab
+++ b/Cython/Utility/ModuleSetupCode.c
f6bfab
@@ -669,7 +669,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
f6bfab
 #if defined(__clang__)
f6bfab
     #define CYTHON_SMALL_CODE
f6bfab
 #elif defined(__GNUC__)
f6bfab
-    #define CYTHON_SMALL_CODE __attribute__((optimize("Os")))
f6bfab
+    #define CYTHON_SMALL_CODE __attribute__((cold))
f6bfab
 #else
f6bfab
     #define CYTHON_SMALL_CODE
f6bfab
 #endif