gallium: New ALIGN_STACK macro to tell gcc to align stack pointer.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 14 Oct 2009 16:11:08 +0000 (17:11 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 14 Oct 2009 16:24:22 +0000 (17:24 +0100)
src/gallium/include/pipe/p_compiler.h

index c13cffceb0a48e65a2ccb761e7cd84039f03e4cf..c36286f9bee49b1eac55f3c798f5dad8a9b7c41a 100644 (file)
@@ -167,11 +167,17 @@ typedef unsigned char boolean;
 #define ALIGN16_ASSIGN(NAME) NAME##___aligned
 #define ALIGN16_ATTRIB  __attribute__(( aligned( 16 ) ))
 #define ALIGN8_ATTRIB  __attribute__(( aligned( 8 ) ))
+#if __GNUC__ > 4 || (__GNUC__ == 4 &&__GNUC_MINOR__>1)
+#define ALIGN_STACK __attribute__((force_align_arg_pointer))
+#else
+#define ALIGN_STACK
+#endif
 #else
 #define ALIGN16_DECL(TYPE, NAME, SIZE)  TYPE NAME##___unaligned[SIZE + 1]
 #define ALIGN16_ASSIGN(NAME) align16(NAME##___unaligned)
 #define ALIGN16_ATTRIB
 #define ALIGN8_ATTRIB
+#define ALIGN_STACK
 #endif