Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #29083, not eliminating kwfunc due to logic error in builtin_nothrow #29086

Merged
merged 1 commit into from
Sep 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base/compiler/tfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ function _builtin_nothrow(@nospecialize(f), argtypes::Array{Any,1}, @nospecializ
length(argtypes) == 1 || return false
return sizeof_nothrow(argtypes[1])
elseif f === Core.kwfunc
length(argtypes) == 2 || return false
length(argtypes) == 1 || return false
return isa(rt, Const)
end
return false
Expand Down
10 changes: 10 additions & 0 deletions test/inline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ let a = read21311()
@test a[] == 1
end

# issue #29083
f29083(;μ,σ) = μ + σ*randn()
g29083() = f29083(μ=2.0,σ=0.1)
let c = code_typed(g29083, ())[1][1].code
# make sure no call to kwfunc remains
@test !any(e->(isa(e,Expr) && ((e.head === :invoke && e.args[1].def.name === :kwfunc) ||
(e.head === :foreigncall && e.args[1] === QuoteNode(:jl_get_keyword_sorter)))),
c)
end

@testset "issue #19122: [no]inline of short func. def. with return type annotation" begin
exf19122 = @macroexpand(@inline f19122()::Bool = true)
exg19122 = @macroexpand(@noinline g19122()::Bool = true)
Expand Down