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

forward-port the test cases added in #53076 #53077

Merged
merged 1 commit into from
Jan 29, 2024
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/ssair/inlining.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ function compute_inlining_cases(@nospecialize(info::CallInfo), flag::UInt32, sig
fully_covered &= split_fully_covered
end

(handled_all_cases && fully_covered) || (joint_effects = Effects(joint_effects; nothrow=false))
(handled_all_cases & fully_covered) || (joint_effects = Effects(joint_effects; nothrow=false))

if handled_all_cases && revisit_idx !== nothing
# we handled everything except one match with unmatched sparams,
Expand Down
17 changes: 17 additions & 0 deletions test/compiler/inline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2116,3 +2116,20 @@ let src = code_typed1() do
end
@test count(isinvoke(:iterate), src.code) == 0
end

# JuliaLang/julia#53062: proper `joint_effects` for call with empty method matches
let ir = first(only(Base.code_ircode(setproperty!, (Base.RefValue{Int},Symbol,Base.RefValue{Int}))))
i = findfirst(iscall((ir, convert)), ir.stmts.stmt)::Int
@test iszero(ir.stmts.flag[i] & Core.Compiler.IR_FLAG_NOTHROW)
end
function issue53062(cond)
x = Ref{Int}(0)
if cond
x[] = x
else
return -1
end
end
@test !Core.Compiler.is_nothrow(Base.infer_effects(issue53062, (Bool,)))
@test issue53062(false) == -1
@test_throws MethodError issue53062(true)