You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
If we compile a program using single-path, and that program includes a conditional return inside a loop, the resulting executable will produce the wrong result.
Take this program (main.c):
The program should print 10 if given an input integer below 7 and 7 otherwise. (the highest input integer allowed is 13). But, if compiled with the command patmos-clang main.c -mpatmos-singlepath and run on pasim with the command echo 6 | pasim a.out, the result is 0 (should be 10).
For all other inputs the result is correct. For some reason, when x starts out at 6, the x += 10; is skipped.
This error is similar to #19, so they might be caused by the same bug.
We might also note, that if the above program did not have the loop bound pragma, it would compile and execute correctly. However, this is because, without a loop bound, the loop is not generated as single-path code.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
If we compile a program using single-path, and that program includes a conditional return inside a loop, the resulting executable will produce the wrong result.
Take this program (
main.c
):The program should print
10
if given an input integer below7
and7
otherwise. (the highest input integer allowed is13
). But, if compiled with the commandpatmos-clang main.c -mpatmos-singlepath
and run onpasim
with the commandecho 6 | pasim a.out
, the result is0
(should be10
).For all other inputs the result is correct. For some reason, when
x
starts out at6
, thex += 10;
is skipped.This error is similar to #19, so they might be caused by the same bug.
We might also note, that if the above program did not have the loop bound pragma, it would compile and execute correctly. However, this is because, without a loop bound, the loop is not generated as single-path code.
The text was updated successfully, but these errors were encountered: