From 9fecc19430295637c5dbcfa24744a4a4f46439de Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Wed, 26 Jun 2024 00:38:54 -0400 Subject: [PATCH] fix effects for Float64^Int on 32 bit (#54934) fixes https://github.com/JuliaLang/julia/pull/54910 properly. The recursion heuristic was getting mad at this for some reason... --- base/math.jl | 4 +--- test/math.jl | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/base/math.jl b/base/math.jl index 14242ba381cde..de275a2afc048 100644 --- a/base/math.jl +++ b/base/math.jl @@ -1328,9 +1328,7 @@ end end @constprop :aggressive @inline function ^(x::Float64, n::Integer) - x^clamp(n, Int64) -end -@constprop :aggressive @inline function ^(x::Float64, n::Int64) + n = clamp(n, Int64) n == 0 && return one(x) if use_power_by_squaring(n) return pow_body(x, n) diff --git a/test/math.jl b/test/math.jl index eb0318a9c4a55..c0a2d8bf8c9f8 100644 --- a/test/math.jl +++ b/test/math.jl @@ -1602,10 +1602,8 @@ end @test Core.Compiler.is_foldable(effects) end end - @static if Sys.WORD_SIZE != 32 # COMBAK debug this - @testset let effects = Base.infer_effects(^, (T,Int)) - @test Core.Compiler.is_foldable(effects) - end + @testset let effects = Base.infer_effects(^, (T,Int)) + @test Core.Compiler.is_foldable(effects) end @testset let effects = Base.infer_effects(^, (T,T)) @test Core.Compiler.is_foldable(effects)