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

Incorrect result of out-of-bounds getindex on tuple of singletons #27910

Closed
cafaxo opened this issue Jul 2, 2018 · 0 comments
Closed

Incorrect result of out-of-bounds getindex on tuple of singletons #27910

cafaxo opened this issue Jul 2, 2018 · 0 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior compiler:optimizer Optimization passes (mostly in base/compiler/ssair/)

Comments

@cafaxo
Copy link
Contributor

cafaxo commented Jul 2, 2018

When evaluating ((),)[2], the expected result is the throw of a BoundsError.
Instead, the result is simply (). This behavior is incorrect.

Discussion on discourse: https://discourse.julialang.org/t/inconsistent-bounds-checking-of-tuples/12102

@Keno Keno self-assigned this Jul 2, 2018
Keno added a commit that referenced this issue Jul 3, 2018
As part of the new optimizer work, I wrote a more accurate effect_free
predicate (stmt_effect_free). However, the old optimizer's less accurate
predicate stuck around and snuck into two places
 1) The inliner
 2) The optimize.jl code that computes proven_pure

As a result, the compiler would eliminate certain statements, even if it could
not prove that they were effect_free. Fix all that by getting rid
of the old predicate and using the new one everywhere.

Fixes #27910
Keno added a commit that referenced this issue Jul 3, 2018
Fixes #9765 (the correctness fix was part of the fix for #27910)
@JeffBezanson JeffBezanson added compiler:optimizer Optimization passes (mostly in base/compiler/ssair/) bug Indicates an unexpected problem or unintended behavior labels Jul 3, 2018
Keno added a commit that referenced this issue Jul 5, 2018
As part of the new optimizer work, I wrote a more accurate effect_free
predicate (stmt_effect_free). However, the old optimizer's less accurate
predicate stuck around and snuck into two places
 1) The inliner
 2) The optimize.jl code that computes proven_pure

As a result, the compiler would eliminate certain statements, even if it could
not prove that they were effect_free. Fix all that by getting rid
of the old predicate and using the new one everywhere.

Fixes #27910
Keno added a commit that referenced this issue Jul 5, 2018
Fixes #9765 (the correctness fix was part of the fix for #27910)
Keno added a commit that referenced this issue Jul 6, 2018
As part of the new optimizer work, I wrote a more accurate effect_free
predicate (stmt_effect_free). However, the old optimizer's less accurate
predicate stuck around and snuck into two places
 1) The inliner
 2) The optimize.jl code that computes proven_pure

As a result, the compiler would eliminate certain statements, even if it could
not prove that they were effect_free. Fix all that by getting rid
of the old predicate and using the new one everywhere.

Fixes #27910
Keno added a commit that referenced this issue Jul 6, 2018
Fixes #9765 (the correctness fix was part of the fix for #27910)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior compiler:optimizer Optimization passes (mostly in base/compiler/ssair/)
Projects
None yet
Development

No branches or pull requests

3 participants