Skip to content

Commit

Permalink
fix effects for Float64^Int on 32 bit (#54934)
Browse files Browse the repository at this point in the history
fixes #54910 properly.

The recursion heuristic was getting mad at this for some reason...
  • Loading branch information
oscardssmith authored Jun 26, 2024
1 parent 07f7efd commit 9fecc19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions base/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions test/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9fecc19

Please sign in to comment.