diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index b17a48f893cd1..8f917e03f472e 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -2441,11 +2441,9 @@ function abstract_eval_globalref(interp::AbstractInterpreter, g::GlobalRef, fram nothrow = false if isa(rt, Const) consistent = ALWAYS_TRUE + nothrow = true if is_mutation_free_argtype(rt) inaccessiblememonly = ALWAYS_TRUE - nothrow = true - else - nothrow = true end elseif isdefined_globalref(g) nothrow = true diff --git a/base/compiler/ssair/inlining.jl b/base/compiler/ssair/inlining.jl index c1c4ee18e8742..5c89a41a22cba 100644 --- a/base/compiler/ssair/inlining.jl +++ b/base/compiler/ssair/inlining.jl @@ -1401,7 +1401,7 @@ function compute_inlining_cases(@nospecialize(info::CallInfo), flag::UInt8, sig: fully_covered &= split_fully_covered end - joint_effects = Effects(joint_effects; nothrow=fully_covered) + 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, diff --git a/test/compiler/irutils.jl b/test/compiler/irutils.jl index 76f883d6cea2c..438c1f2717835 100644 --- a/test/compiler/irutils.jl +++ b/test/compiler/irutils.jl @@ -1,9 +1,13 @@ import Core: CodeInfo, ReturnNode, MethodInstance import Core.Compiler: IRCode, IncrementalCompact, argextype, singleton_type import Base.Meta: isexpr +using InteractiveUtils: gen_call_with_extracted_types_and_kwargs argextype(@nospecialize args...) = argextype(args..., Any[]) code_typed1(args...; kwargs...) = first(only(code_typed(args...; kwargs...)))::CodeInfo +macro code_typed1(ex0...) + return gen_call_with_extracted_types_and_kwargs(__module__, :code_typed1, ex0) +end get_code(args...; kwargs...) = code_typed1(args...; kwargs...).code # check if `x` is a statement with a given `head`