Skip to content

inference bug in OC optimization causes julia to abort #54357

Closed
@vtjnash

Description

@vtjnash

This should neither error, nor should the error cause julia to abort (due to buggy handling / lowering of sparams):

julia> f(g, ::Type{AT}) where {AT} = Base.Experimental.@opaque AT (args...) -> g((args::AT)...)
f (generic function with 1 method)

julia> @code_typed f(+, Tuple{Int,Int})(1, 2, 3)
Internal error: during type inference of
f(Function, Type{Tuple{Int64, Int64}})
Encountered unexpected error in runtime:
BoundsError(a=Array{Core.Compiler.VarState, 1}(dims=(0,), mem=Memory{Core.Compiler.VarState}(0, 0x7f42815330b0)[]), i=(1,))
throw_boundserror at ./essentials.jl:14
getindex at ./essentials.jl:893 [inlined]
stmt_effect_flags at ./compiler/optimize.jl:313
recompute_effects_flags at ./compiler/optimize.jl:382 [inlined]
add_inst_flag! at ./compiler/ssair/inlining.jl:1221 [inlined]
add_inst_flag! at ./compiler/ssair/inlining.jl:1218 [inlined]
process_simple! at ./compiler/ssair/inlining.jl:1248
assemble_inline_todo! at ./compiler/ssair/inlining.jl:1619
ssa_inlining_pass! at ./compiler/ssair/inlining.jl:80 [inlined]
run_passes_ipo_safe at ./compiler/optimize.jl:976
run_passes_ipo_safe at ./compiler/optimize.jl:991 [inlined]
optimize at ./compiler/optimize.jl:965

[3198871] signal 6 (-6): Aborted

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions