-
Notifications
You must be signed in to change notification settings - Fork 58
for loop executes once when condition is already met #1207
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
Labels
Comments
mhasel
added a commit
that referenced
this issue
Jun 17, 2024
This PR fixes for loops executing once when the predicate already should not be met for decrementing loops. I have also re-implemented the codegen logic for for-loops, resulting in fewer predecessors and hopefully more readable IR. Resolves #1207
mhasel
added a commit
that referenced
this issue
Jun 17, 2024
This PR fixes for loops executing once when the predicate already should not be met for decrementing loops. I have also re-implemented the codegen logic for for-loops, resulting in fewer predecessors and hopefully more readable IR. Resolves #1207
mhasel
added a commit
that referenced
this issue
Jun 17, 2024
This PR fixes for loops executing once when the predicate already should not be met for decrementing loops. I have also re-implemented the codegen logic for for-loops, resulting in fewer predecessors and hopefully more readable IR. Resolves #1207
mhasel
added a commit
that referenced
this issue
Jun 17, 2024
This PR fixes for loops executing once when the predicate already should not be met for decrementing loops. I have also re-implemented the codegen logic for for-loops, resulting in fewer predecessors and hopefully more readable IR. Resolves #1207
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Discussed in #1206
Originally posted by kanishka-karan April 19, 2024
Hi
We are using decrement for loop :
The output of the program is :
It shows that the for loop code is executing once even if
end
is equal to -1. We think it should not run the code insidefor
loop, as the condition is not met.We interpreted the Structured text for loop
as in C/C++ as
Please let us know if we our understanding is correct.
Thank You
The text was updated successfully, but these errors were encountered: