summaryrefslogtreecommitdiffstats
path: root/include/linux/compiler-gcc4.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2013-10-11 07:39:37 +0200
committerIngo Molnar <mingo@kernel.org>2013-10-11 07:39:37 +0200
commitec0ad3d01f99d5e5b56a99a58f7003b99250dc65 (patch)
tree85066cbea1cf8da6d099019adefaca90aae39234 /include/linux/compiler-gcc4.h
parent3354781a2184380046c8dd19144628d3c33991e6 (diff)
parent3f0116c3238a96bc18ad4b4acefe4e7be32fa861 (diff)
Merge branch 'core/urgent' into sched/core
Merge in asm goto fix, to be able to apply the asm/rmwcc.h fix. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/compiler-gcc4.h')
-rw-r--r--include/linux/compiler-gcc4.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index 842de225055..ded429966c1 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -65,6 +65,21 @@
#define __visible __attribute__((externally_visible))
#endif
+/*
+ * GCC 'asm goto' miscompiles certain code sequences:
+ *
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
+ *
+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
+ * Fixed in GCC 4.8.2 and later versions.
+ *
+ * (asm goto is automatically volatile - the naming reflects this.)
+ */
+#if GCC_VERSION <= 40801
+# define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
+#else
+# define asm_volatile_goto(x...) do { asm goto(x); } while (0)
+#endif
#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
#if GCC_VERSION >= 40400