diff --git a/include/ck_cc.h b/include/ck_cc.h index b1549bb..c5f17a4 100644 --- a/include/ck_cc.h +++ b/include/ck_cc.h @@ -45,4 +45,8 @@ #define CK_CC_PAD(x) union { char pad[x]; } +#ifndef CK_CC_ALIASED +#define CK_CC_ALIASED +#endif + #endif /* _CK_CC_H */ diff --git a/include/gcc/ck_cc.h b/include/gcc/ck_cc.h index 15743e7..f7b13a7 100644 --- a/include/gcc/ck_cc.h +++ b/include/gcc/ck_cc.h @@ -75,4 +75,11 @@ #pragma GCC poison malloc free #endif +/* + * Some compilers are overly strict regarding aliasing semantics. + * Unfortunately, in many cases it makes more sense to pay aliasing + * cost rather than overly expensive register spillage. + */ +#define CK_CC_ALIASED __attribute__((__may_alias__)) + #endif /* _CK_GCC_CC_H */