diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index 005fcd6dbe467..dcf7409c7bde4 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -1778,7 +1778,8 @@ const _EFFECT_FREE_BUILTINS = [ ] const _CONSISTENT_BUILTINS = Any[ - tuple, # tuple is immutable, thus tuples of egal arguments are egal + tuple, # Tuple is immutable, thus tuples of egal arguments are egal + svec, # SimpleVector is immutable, thus svecs of egal arguments are egal ===, typeof, nfields, diff --git a/test/compiler/effects.jl b/test/compiler/effects.jl index 8180e1e566a3b..1d1107702bb75 100644 --- a/test/compiler/effects.jl +++ b/test/compiler/effects.jl @@ -176,3 +176,9 @@ end @test Base.infer_effects((Vector{Int},Int)) do a, i a[i] = 0 # may throw end |> !Core.Compiler.is_nothrow + +# SimpleVector allocation can be consistent +@test Core.Compiler.is_consistent(Base.infer_effects(Core.svec)) +@test Base.infer_effects() do + Core.svec(nothing, 1, "foo") +end |> Core.Compiler.is_consistent