Skip to content

Commit

Permalink
* vm_exec.h (END_INSN): llvm-gcc may optimize out reg_cfp and cause
Browse files Browse the repository at this point in the history
  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 ruby#7938]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nurse committed Feb 27, 2013
1 parent 7c4084f commit 4cc2a6b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Wed Feb 27 12:13:32 2013 NARUSE, Yui <[email protected]>

* 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]

Wed Feb 27 10:23:00 2013 Zachary Scott <[email protected]>

* thread.c (thread_raise_m): rdoc formatting
Expand Down
14 changes: 13 additions & 1 deletion vm_exec.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__) \
Expand Down

0 comments on commit 4cc2a6b

Please sign in to comment.