Project

General

Profile

Actions

Bug #20477

closed

RJIT NoMatchingPatternError when initialize Hash literal with more 8 items

Added by ukolovda (Dmitry Ukolov) about 2 months ago. Updated about 2 months ago.

Status:
Feedback
Target version:
-
ruby -v:
ruby 3.3.1 (2024-04-23 revision c56cd86388) [x86_64-linux]
[ruby-core:117804]

Description

When I create Hash with 8 or more items, I got the error:

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:

# 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).


Related issues 1 (0 open1 closed)

Copied from Ruby master - Bug #20475: RJIT `and' NoMatchingPatternErrorFeedbackk0kubun (Takashi Kokubun)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0