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

Eliminate array bounds check for trivial case #13288

Closed
frangio opened this issue Jul 21, 2022 · 2 comments
Closed

Eliminate array bounds check for trivial case #13288

frangio opened this issue Jul 21, 2022 · 2 comments
Labels
closed due inactivity The issue/PR was automatically closed due to inactivity. nice to have We don’t see a good reason not to have it but won’t go out of our way to implement it. optimizer stale The issue/PR was marked as stale because it has been open for too long.

Comments

@frangio
Copy link
Contributor

frangio commented Jul 21, 2022

The following code seems to do the bounds check even though it is trivially unnecessary.

uint[] memory a = new uint[](1);
a[0] = x;

Ideally the optimizer would also catch less trivial but apparently easy cases like for loops where the index is checked to be in bounds as part of the loop condition.

Related: #9117

@cameel cameel moved this to Triage in Solidity Focus Board Jul 22, 2022
@Marenz Marenz added optimizer nice to have We don’t see a good reason not to have it but won’t go out of our way to implement it. labels Aug 29, 2022
@nishant-sachdeva nishant-sachdeva moved this from Triage to Design/Decide in Solidity Focus Board Aug 29, 2022
@github-actions
Copy link

This issue has been marked as stale due to inactivity for the last 90 days.
It will be automatically closed in 7 days.

@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Mar 30, 2023
@github-actions
Copy link

github-actions bot commented Apr 7, 2023

Hi everyone! This issue has been automatically closed due to inactivity.
If you think this issue is still relevant in the latest Solidity version and you have something to contribute, feel free to reopen.
However, unless the issue is a concrete proposal that can be implemented, we recommend starting a language discussion on the forum instead.

@github-actions github-actions bot added the closed due inactivity The issue/PR was automatically closed due to inactivity. label Apr 7, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed due inactivity The issue/PR was automatically closed due to inactivity. nice to have We don’t see a good reason not to have it but won’t go out of our way to implement it. optimizer stale The issue/PR was marked as stale because it has been open for too long.
Projects
None yet
Development

No branches or pull requests

2 participants