Commit 9ddac715 authored by Stefan Behnel's avatar Stefan Behnel

Replace GCC's attribute optimize("Os") by the better supported and similar (cold).

Closes #2494.
parent 27f6c580
...@@ -57,6 +57,10 @@ Bugs fixed ...@@ -57,6 +57,10 @@ Bugs fixed
exception stack traces. exception stack traces.
Patch by Jeroen Demeyer. (Github issue #2492) Patch by Jeroen Demeyer. (Github issue #2492)
* The discouraged usage of GCC's attribute ``optimize("Os")`` was replaced by the
similar attribute ``cold`` to reduce the code impact of the module init functions.
(Github issue #2494)
Other changes Other changes
------------- -------------
......
...@@ -677,9 +677,8 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { ...@@ -677,9 +677,8 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
#ifndef CYTHON_SMALL_CODE #ifndef CYTHON_SMALL_CODE
#if defined(__clang__) #if defined(__clang__)
#define CYTHON_SMALL_CODE #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4))) #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
// At least g++ 4.4.7 can generate crashing code with this option. (GH #2235) #define CYTHON_SMALL_CODE __attribute__((cold))
#define CYTHON_SMALL_CODE __attribute__((optimize("Os")))
#else #else
#define CYTHON_SMALL_CODE #define CYTHON_SMALL_CODE
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment