Skip to content

Conversation

lgoettgens
Copy link
Contributor

The issue is that JET reported that in libgfortran_version(p).major the first arg of getproperty could be nothing. This is already checked in the previous line, but in a way that the compiler cannot remember until that call. Putting it into a variable should fix that.

It would be great if this could get backported to at least 1.12 (1.10 and 1.11 would also be great), since that is where people try to use JET for their packages, and this reduces the Base noise in the output.

Copy link
Member

@giordano giordano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I presume the issue is that these functions have very bad effects and so the compiler can't assume they're consistent?

julia> Base.infer_effects(Base.BinaryPlatforms.libgfortran_version, (Base.BinaryPlatforms.Platform,))
(!c,!e,!n,!t,!s,!m,!u,+o,!r)

Copy link
Member

@aviatesk aviatesk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue isn't about effects. Since effect analysis isn't integrated into the current compiler's abstract interpretation routine, it can't propagate type constraints that can be deduced from accessing mutable fields.

@aviatesk aviatesk merged commit 2ec3fa8 into JuliaLang:master Aug 21, 2025
8 checks passed
aviatesk pushed a commit that referenced this pull request Aug 21, 2025
…m)` (#59343)

The issue is that JET reported that in `libgfortran_version(p).major`
the first arg of `getproperty` could be `nothing`. This is already
checked in the previous line, but in a way that the compiler cannot
remember until that call. Putting it into a variable should fix that.

It would be great if this could get backported to at least 1.12 (1.10
and 1.11 would also be great), since that is where people try to use JET
for their packages, and this reduces the Base noise in the output.
@lgoettgens lgoettgens deleted the lg/JET-triplet-AbstractPlatform branch August 21, 2025 05:36
@lgoettgens
Copy link
Contributor Author

Thanks for merging. Can we get a backport label here?

@aviatesk
Copy link
Member

I already backported this to 1.12-rc2

KristofferC pushed a commit that referenced this pull request Sep 2, 2025
…m)` (#59343)

The issue is that JET reported that in `libgfortran_version(p).major`
the first arg of `getproperty` could be `nothing`. This is already
checked in the previous line, but in a way that the compiler cannot
remember until that call. Putting it into a variable should fix that.

It would be great if this could get backported to at least 1.12 (1.10
and 1.11 would also be great), since that is where people try to use JET
for their packages, and this reduces the Base noise in the output.
KristofferC pushed a commit that referenced this pull request Sep 15, 2025
…m)` (#59343)

The issue is that JET reported that in `libgfortran_version(p).major`
the first arg of `getproperty` could be `nothing`. This is already
checked in the previous line, but in a way that the compiler cannot
remember until that call. Putting it into a variable should fix that.

It would be great if this could get backported to at least 1.12 (1.10
and 1.11 would also be great), since that is where people try to use JET
for their packages, and this reduces the Base noise in the output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants