ruby-changes:50258
From: k0kubun <ko1@a...>
Date: Mon, 12 Feb 2018 10:00:37 +0900 (JST)
Subject: [ruby-changes:50258] k0kubun:r62376 (trunk): mjit_compile.c: fix invalid suffix on MinGW
k0kubun 2018-02-12 10:00:30 +0900 (Mon, 12 Feb 2018) New Revision: 62376 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62376 Log: mjit_compile.c: fix invalid suffix on MinGW This commit fixes following error. $ RUBY_FORCE_TEST_JIT=1 ./ruby -I. -Ilib -Itest/lib --disable-gems test/ruby/test_jit.rb Run options: # Running tests: Environment variable changed: TestJIT#test_compile_insns : "TEMP" changed : "C:\\msys64\\tmp" -> "C:\\Users\\k0kubun\\AppData\\Local\\Temp" Environment variable changed: TestJIT#test_compile_insns : "TMP" changed : "C:\\msys64\\tmp" -> "C:\\Users\\k0kubun\\AppData\\Local\\Temp" Environment variable changed: TestJIT#test_compile_insns : "temp" deleted Environment variable changed: TestJIT#test_compile_insns : "tmp" deleted 1) Failure: TestJIT#test_jit_output [test/ruby/test_jit.rb:360]: Expected /^JIT success \(\d+\.\dms\): block in <main>@-e:1 -> .+_ruby_mjit_p\d+u\d+\.c$/ to match "C:/Users/k0kubun/AppData/Local/temp/_ruby_mjit_p920u0.c: In function '_mjit0':\n" + "C:/Users/k0kubun/AppData/Local/temp/_ruby_mjit_p920u0.c:11:61: error: invalid suffix \"CD6900\" on integer constant\n" + " static const VALUE *const original_body_iseq = (VALUE *)0000000004CD6900;\n" + " ^~~~~~~~~~~~~~~~\n" + "compilation terminated due to -Wfatal-errors.\n" + "Successful MJIT finish\n". 2) Failure: TestJIT#test_compile_insns [test/ruby/test_jit.rb:19]: Expected 1 times of JIT success, but succeeded 0 times. script: ``` p proc { nil rescue true }.call ``` stderr: ``` C:/Users/k0kubun/AppData/Local/temp/_ruby_mjit_p10628u0.c: In function '_mjit0': C:/Users/k0kubun/AppData/Local/temp/_ruby_mjit_p10628u0.c:11:61: error: invalid suffix "D05F10" on integer constant static const VALUE *const original_body_iseq = (VALUE *)0000000004D05F10; ^~~~~~~~~~~~~~~~ compilation terminated due to -Wfatal-errors. Successful MJIT finish ``` . <1> expected but was <0>. Finished tests in 3.028989s, 0.6603 tests/s, 1.9809 assertions/s. 2 tests, 6 assertions, 2 failures, 0 errors, 0 skips ruby -v: ruby 2.6.0dev (2018-02-11 trunk 62375) [x64-mingw32] Modified files: trunk/mjit_compile.c Index: mjit_compile.c =================================================================== --- mjit_compile.c (revision 62375) +++ mjit_compile.c (revision 62376) @@ -164,8 +164,8 @@ mjit_compile(FILE *f, const struct rb_is https://github.com/ruby/ruby/blob/trunk/mjit_compile.c#L164 #endif fprintf(f, "VALUE\n%s(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp)\n{\n", funcname); fprintf(f, " VALUE *stack = reg_cfp->sp;\n"); - fprintf(f, " static const VALUE *const original_body_iseq = (VALUE *)%p;\n", - body->iseq_encoded); + fprintf(f, " static const VALUE *const original_body_iseq = (VALUE *)0x%"PRIxVALUE";\n", + (VALUE)body->iseq_encoded); /* Simulate `opt_pc` in setup_parameters_complex */ if (body->param.flags.has_opt) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/