diff options
author | Kavon Farvardin <kavon@farvard.in> | 2018-09-23 15:29:37 -0500 |
---|---|---|
committer | Kavon Farvardin <kavon@farvard.in> | 2018-09-23 15:29:37 -0500 |
commit | 84c2ad99582391005b5e873198b15e9e9eb4f78d (patch) | |
tree | caa8c2f2ec7e97fbb4977263c6817c9af5025cf4 /includes/Stg.h | |
parent | 8ddb47cfcf5776e9a3c55fd37947c8a95e00fa12 (diff) | |
parent | e68b439fe5de61b9a2ca51af472185c62ccb8b46 (diff) | |
download | haskell-wip/T13904.tar.gz |
update to current master againwip/T13904
Diffstat (limited to 'includes/Stg.h')
-rw-r--r-- | includes/Stg.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/includes/Stg.h b/includes/Stg.h index f377e50d98..19069d8c1a 100644 --- a/includes/Stg.h +++ b/includes/Stg.h @@ -196,7 +196,7 @@ #define GNUC3_ATTRIBUTE(at) #endif -#if __GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 3 +#if !defined(DEBUG) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define GNUC_ATTR_HOT __attribute__((hot)) #else #define GNUC_ATTR_HOT /* nothing */ @@ -204,6 +204,16 @@ #define STG_UNUSED GNUC3_ATTRIBUTE(__unused__) +/* Prevent functions from being optimized. + See Note [Windows Stack allocations] */ +#if defined(__clang__) +#define STG_NO_OPTIMIZE __attribute__((optnone)) +#elif defined(__GNUC__) || defined(__GNUG__) +#define STG_NO_OPTIMIZE __attribute__((optimize("O0"))) +#else +#define STG_NO_OPTIMIZE /* nothing */ +#endif + /* ----------------------------------------------------------------------------- Global type definitions -------------------------------------------------------------------------- */ |