Skip to content

Compiler bug uncovered by BaseBenchmarks #29107

Closed
@Keno

Description

@Keno

Last night's nanosolider run showed regressions in the perf_sumvector benchmarks. Running those locally, we see that they in fact trigger a compiler error:

julia> function perf_sumvector(A)
           s = zero(eltype(A))
           nrows = size(A, 1)
           ncols = size(A, 2)
           r = rand(1:nrows, 5)
           @simd for i = 1:ncols
               val = Base.unsafe_getindex(A, r, i)
               s += first(val)
           end
           return s
       end
perf_sumvector (generic function with 1 method)

julia> using BenchmarkTools
[ Info: Recompiling stale cache file /home/keno/.julia/compiled/v1.1/BenchmarkTools/ZXPQo.ji for BenchmarkTools [6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf]

julia> @btime perf_sumvector($(1:100000))
Internal error: encountered unexpected error in runtime:
BoundsError(a=Array{Core.Compiler.NewNode, (0,)}[], i=(1,))
rec_backtrace at /home/keno/julia-1.0/src/stackwalk.c:94
record_backtrace at /home/keno/julia-1.0/src/task.c:249
jl_throw at /home/keno/julia-1.0/src/task.c:580
jl_bounds_error_ints at /home/keno/julia-1.0/src/rtutils.c:187
getindex at ./array.jl:731 [inlined]
abstract_eval_ssavalue at ./compiler/ssair/queries.jl:59 [inlined]
argextype at ./compiler/utilities.jl:181
argextype at ./compiler/utilities.jl:167 [inlined]
stmt_effect_free at ./compiler/ssair/queries.jl:28
maybe_erase_unused! at ./compiler/ssair/ir.jl:1130
maybe_erase_unused! at ./compiler/ssair/ir.jl:1125 [inlined]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorcompiler:optimizerOptimization passes (mostly in base/compiler/ssair/)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions