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

Invalid loop bounds in rijndael benchmarks #44

Open
Emoun opened this issue Apr 5, 2024 · 3 comments
Open

Invalid loop bounds in rijndael benchmarks #44

Emoun opened this issue Apr 5, 2024 · 3 comments

Comments

@Emoun
Copy link
Contributor

Emoun commented Apr 5, 2024

The two rijndael benchmarks rijndael_dec and rijndael_enc have invalid loop bounds that mean they cannot be WCET analyzed.

For rijndael_dec, the problem is in aes.c's rijndael_dec_set_key function where a do-while loop (line 90) is given the bounds _Pragma( "loopbound min 0 max 0" ). The same happens again on line 103.
This cannot be ignored as this function is directly called from rijndael_dec_main and so are part of the benchmarked code.
A 0 bound is meaningless and can therefore not be used as a basis for WCET analysis.

rijndael_enc has the exact same problem with its rijndael_enc_set_key function.

The true bounds for these loops must be found so the code can be corrected.

@blisper
Copy link
Contributor

blisper commented Apr 10, 2024 via email

@Emoun
Copy link
Contributor Author

Emoun commented Apr 11, 2024

@blisper could you elaborate on the usefulness of allowing upper bounds of 0? In which cases would a 0-bounded loop be preferable to just removing the code from the program?
I'm here thinking only of statically known bounds of 0. I of course see the use of dynamic loop bounds (e.g. that an analyzer would find) evaluating to 0 under certain conditions.

In this case specifically, the 0-bounds are set on do-while loops. do-while loops' bodies will be run at least once, contradicting the bound. Our Patmos compiler disallows do-while loops with a static 0-bound so that such contradictions can be caught at compile time. Therefore, I still feel a refinement of the bounds in these programs is preferable.

@blisper
Copy link
Contributor

blisper commented Apr 11, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants