gdb.rocm/step-schedlock-spurious-waves: fix failure at -O3 - #296
Open
lumachad wants to merge 1 commit into
Open
Conversation
At -O3 the compiler collapses kern's loop body to fewer source line mappings, causing the stepped wave to reach end_of_kernel in only 2 next commands instead of 5. The test's next loop then fails to match its expected pattern when the end_of_kernel breakpoint fires. Apply __attribute__ ((optnone)) to kern, mirroring the same attribute already used on end_of_kernel, to keep the loop intact under higher optimization levels and ensure there are enough source lines to step over.
lumachad
marked this pull request as ready for review
August 20, 2026 11:39
Collaborator
Author
|
I've spotted this failing more recently. We should fix this to keep optimization test runs clean. |
This was referenced Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At -O3 the compiler collapses kern's loop body to fewer source line
mappings, causing the stepped wave to reach end_of_kernel in only 2
next commands instead of 5. The test's next loop then fails to match
its expected pattern when the end_of_kernel breakpoint fires.
Apply attribute ((optnone)) to kern, mirroring the same attribute
already used on end_of_kernel, to keep the loop intact under higher
optimization levels and ensure there are enough source lines to step
over.