]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] regparm is broken on gcc < 3
authorWilly Tarreau <w@1wt.eu>
Sun, 17 Aug 2008 15:06:37 +0000 (17:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 17 Aug 2008 15:06:37 +0000 (17:06 +0200)
Gcc < 3 does not consider regparm declarations for function pointers.
This causes big trouble at least with pollers (and with any function
pointer after all). Disable CONFIG_HAP_USE_REGPARM for gcc < 3.

include/common/config.h

index 85deeaed5f97efd5e9a0226433a5a0627b690e28..74bee477eb22abd0a460593a85cfd9597c9d4864 100644 (file)
 
 /* CONFIG_HAP_USE_REGPARM
  * This enables the use of register parameters for some functions where
- * it may improve performance by a measurable factor.
+ * it may improve performance by a measurable factor. This MUST NOT be
+ * enabled on gcc < 3 because it is ignored for function pointers.
  */
-#ifdef CONFIG_HAP_USE_REGPARM
+#if CONFIG_HAP_USE_REGPARM && __GNUC__ >= 3
 #define REGPRM1 __attribute__((regparm(1)))
 #define REGPRM2 __attribute__((regparm(2)))
 #define REGPRM3 __attribute__((regparm(3)))