summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.osdl.org>2003-07-08 08:55:17 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-07-08 08:55:17 -0700
commit3a185ec4544b1e487a156e97b5959f300bac130f (patch)
treee50419465a5909602e7b70f113232481e04ff7bf /include/linux
parente7d4d40ec0a959f76d1070d150e6efb3606c0912 (diff)
parentb84c512679ed7e0b140e1e6a9e00675005b361fd (diff)
Merge bk://kernel.bkbits.net/davem/net-2.5
into home.osdl.org:/home/torvalds/v2.5/linux
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/compiler.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 4ef20f517d27..95baf96090d9 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -56,6 +56,24 @@
#define __attribute_used__ __attribute__((__unused__))
#endif
+/*
+ * From the GCC manual:
+ *
+ * Many functions have no effects except the return value and their
+ * return value depends only on the parameters and/or global
+ * variables. Such a function can be subject to common subexpression
+ * elimination and loop optimization just as an arithmetic operator
+ * would be.
+ * [...]
+ * The attribute `pure' is not implemented in GCC versions earlier
+ * than 2.96.
+ */
+#if (__GNUC__ == 2 && __GNUC_MINOR >= 96) || __GNUC__ > 2
+#define __attribute_pure__ __attribute__((pure))
+#else
+#define __attribute_pure__ /* unimplemented */
+#endif
+
/* This macro obfuscates arithmetic on a variable address so that gcc
shouldn't recognize the original var, and make assumptions about it */
#define RELOC_HIDE(ptr, off) \