
Issue #20477 has been updated by ukolovda (Dmitry Ukolov). Thank you! I guessed, RJIT will be production solution in some future, sorry. ---------------------------------------- Bug #20477: RJIT NoMatchingPatternError when initialize Hash literal with more 8 items https://bugs.ruby-lang.org/issues/20477#change-108216 * Author: ukolovda (Dmitry Ukolov) * Status: Feedback * Assignee: k0kubun (Takashi Kokubun) * ruby -v: ruby 3.3.1 (2024-04-23 revision c56cd86388) [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- When I create Hash with 8 or more items, I got the error: ```bash ruby --rjit -e "a = 1; 1.upto(10) { b={a1: a&1, a2: a&1, a3: a&1, a4: a&1, a5: a&1, a6: a&1, a7: a&1, a8: a&1} }" /home/ukolovda/.rvm/rubies/ruby-3.3.1/lib/ruby/3.3.0/ruby_vm/rjit/assembler.rb:124:in `and': [:rax, [:rbx, 128]] (NoMatchingPatternError) from /home/ukolovda/.rvm/rubies/ruby-3.3.1/lib/ruby/3.3.0/ruby_vm/rjit/insn_compiler.rb:2348:in `opt_and' from /home/ukolovda/.rvm/rubies/ruby-3.3.1/lib/ruby/3.3.0/ruby_vm/rjit/insn_compiler.rb:118:in `compile' from /home/ukolovda/.rvm/rubies/ruby-3.3.1/lib/ruby/3.3.0/ruby_vm/rjit/compiler.rb:321:in `compile_block' from /home/ukolovda/.rvm/rubies/ruby-3.3.1/lib/ruby/3.3.0/ruby_vm/rjit/compiler.rb:150:in `block in branch_stub_hit' from <internal:kernel>:133:in `then' from /home/ukolovda/.rvm/rubies/ruby-3.3.1/lib/ruby/3.3.0/ruby_vm/rjit/compiler.rb:149:in `branch_stub_hit' from -e:1:in `block in <main>' from -e:1:in `upto' from -e:1:in `<main>' ``` Test ruby file: ```ruby # test.rb # Running: ruby --rjit test.rb a = 1 1.upto(10) do b = { a1: a&1, a2: a&1, a3: a&1, a4: a&1, a5: a&1, a6: a&1, a7: a&1, a8: a&1, } end ``` (I described it first in #20475, but it is closed now. Current description is more clear and easy reproduce). -- https://bugs.ruby-lang.org/