aboutsummaryrefslogtreecommitdiffstats
path: root/vm_exec.h
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-27 03:22:50 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-27 03:22:50 +0000
commit4cc2a6b1b1d54617f8582a524101b669a2366b47 (patch)
tree628154820eaa7acd15a52f454f87060786e4a94b /vm_exec.h
parent7c4084f9fb85073ec08450abdf70b24f7b598033 (diff)
downloadruby-4cc2a6b1b1d54617f8582a524101b669a2366b47.tar.gz
* vm_exec.h (END_INSN): llvm-gcc may optimize out reg_cfp and cause
Stack/cfp consistency error when the instruction doesn't use reg_cfp. Usually instructions use PUSH() but for example trace doesn't. This hack cause speed down but you shouldn't use llvm-gcc, use clang. [Bug #7938] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_exec.h')
-rw-r--r--vm_exec.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/vm_exec.h b/vm_exec.h
index 1853be9c2d..d371054bc9 100644
--- a/vm_exec.h
+++ b/vm_exec.h
@@ -116,9 +116,21 @@ error !
#endif /* DISPATCH_DIRECT_THREADED_CODE */
+#if defined(__llvm__) && !defined(__clang__)
+ /* llvm-gcc may optimize out reg_cfp and cause Stack/cfp consistency error
+ * when the instruction doesn't use reg_cfp.
+ * Usually instructions use PUSH() but for example trace doesn't.
+ * This hack cause speed down but you shouldn't use llvm-gcc, use clang.
+ */
#define END_INSN(insn) \
+ { rb_control_frame_t *volatile RB_UNUSED_VAR(tmpcfp) = reg_cfp; } \
DEBUG_END_INSN(); \
- TC_DISPATCH(insn); \
+ TC_DISPATCH(insn);
+#else
+#define END_INSN(insn) \
+ DEBUG_END_INSN(); \
+ TC_DISPATCH(insn);
+#endif
#define INSN_DISPATCH() \
TC_DISPATCH(__START__) \