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

add_ptr has bad :nothrow effects #57557

Open
adienes opened this issue Feb 27, 2025 · 1 comment
Open

add_ptr has bad :nothrow effects #57557

adienes opened this issue Feb 27, 2025 · 1 comment
Assignees
Labels
backport 1.12 Change should be backported to release-1.12 compiler:effects effect analysis regression Regression in behavior compared to a previous version

Comments

@adienes
Copy link
Member

adienes commented Feb 27, 2025

it appears the changes in #53687 caused

julia> Base.infer_effects(+, Tuple{Ptr{UInt8}, UInt})
(+c,+e,!n,+t,+s,+m,+u,+o,+r)

I'm assuming this is a bug as I don't know how that call could throw --- and it does not match the effects on previous versions.

adding @_nothrow_meta to +(x::Ptr, y::Integer) and -(x::Ptr, y::Integer) should fix the symptom for +, but I'm assuming it'd be desirable to fix the intrinsic as well

@adienes adienes added regression Regression in behavior compared to a previous version compiler:effects effect analysis labels Feb 27, 2025
@vtjnash
Copy link
Member

vtjnash commented Feb 27, 2025

It looks like it changed some of the implementation without updating the nothrow modeling here:

julia/base/compiler/tfuncs.jl

Lines 2893 to 2894 in 66dc4d2

# The remaining intrinsics are math/bits/comparison intrinsics. They work on all
# primitive types of the same type.

(I was looking earlier today finding a lot of bugs here and started https://github.com/JuliaLang/julia/pull/new/jn/builtin-effects-free to fix some of them)

@vtjnash vtjnash added the backport 1.12 Change should be backported to release-1.12 label Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.12 Change should be backported to release-1.12 compiler:effects effect analysis regression Regression in behavior compared to a previous version
Projects
None yet
Development

No branches or pull requests

3 participants