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

Unreachable reached due to TypedSlot removal #51159

Closed
maleadt opened this issue Sep 2, 2023 · 0 comments · Fixed by #51199
Closed

Unreachable reached due to TypedSlot removal #51159

maleadt opened this issue Sep 2, 2023 · 0 comments · Fixed by #51199
Assignees
Labels
compiler:optimizer Optimization passes (mostly in base/compiler/ssair/) kind:regression Regression in behavior compared to a previous version
Milestone

Comments

@maleadt
Copy link
Member

maleadt commented Sep 2, 2023

MWE:

function f()
    result = false
    for i in 3
        result = try
        catch
            continue
        end
    end
    result
end
f()
$ manyjulias master wip.jl
[ Info: Translated requested revision master to commit ec2f1d3c0b2a37b5acafeaab2454fedbd83a31ab
Unreachable reached at 0x7f39379632a6

[2123194] signal (4.2): Illegal instruction
in expression starting at /home/maleadt/julia/wip.jl:16
f at /home/maleadt/julia/wip.jl:9

Bisected to #50943

As spotted on PkgEval during BeaData.jl tests: https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_date/2023-09/01/BeaData.primary.log (but code mostly comes from Retry.jl).

@maleadt maleadt added kind:regression Regression in behavior compared to a previous version compiler:optimizer Optimization passes (mostly in base/compiler/ssair/) labels Sep 2, 2023
@maleadt maleadt added this to the 1.11 milestone Sep 2, 2023
topolarity added a commit to topolarity/julia that referenced this issue Sep 5, 2023
The unreachable here seems to be caused by the fact that (as of JuliaLang#50299) we
re-use a more narrow type from Inference that correctly ignores these
edges, but when inserting the `φᶜ` node in `slot2reg` we were including
extra edges that never get exercised at runtime.

I'm not sure _why_ this causes us to hit an unreachable, since the narrow
type from inference is technically still valid (the catch block will never
observe these spurious assignments at runtime), but this seems to fix the
issue and anyway improves the quality of the IRCode generated by `slot2ssa`.

Resolves JuliaLang#51159
topolarity added a commit that referenced this issue Sep 6, 2023
The unreachable here seems to be caused by the fact that (as of #50943)
we re-use a more narrow type from Inference that correctly ignores these
edges, but when inserting the `φᶜ` node in `slot2reg` we were including
extra edges that never get exercised at runtime.

I'm not sure _why_ this causes us to hit an unreachable, since the
narrow type from inference is technically still valid (the catch block
will never observe these spurious assignments at runtime), but this
seems to fix the issue and anyway improves the quality of the IRCode
generated by `slot2ssa`.

Resolves #51159
aviatesk pushed a commit that referenced this issue Sep 7, 2023
The unreachable here seems to be caused by the fact that (as of #50299) we
re-use a more narrow type from Inference that correctly ignores these
edges, but when inserting the `φᶜ` node in `slot2reg` we were including
extra edges that never get exercised at runtime.

I'm not sure _why_ this causes us to hit an unreachable, since the narrow
type from inference is technically still valid (the catch block will never
observe these spurious assignments at runtime), but this seems to fix the
issue and anyway improves the quality of the IRCode generated by `slot2ssa`.

Resolves #51159
aviatesk pushed a commit that referenced this issue Sep 7, 2023
The unreachable here seems to be caused by the fact that (as of #50299) we
re-use a more narrow type from Inference that correctly ignores these
edges, but when inserting the `φᶜ` node in `slot2reg` we were including
extra edges that never get exercised at runtime.

I'm not sure _why_ this causes us to hit an unreachable, since the narrow
type from inference is technically still valid (the catch block will never
observe these spurious assignments at runtime), but this seems to fix the
issue and anyway improves the quality of the IRCode generated by `slot2ssa`.

Resolves #51159
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:optimizer Optimization passes (mostly in base/compiler/ssair/) kind:regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants