Repository navigation
runtime: allow compile-time synctest checks on bare metal - #5974
Open
davecheney wants to merge 1 commit into
Open
davecheney wants to merge 1 commit into
davecheney wants to merge 1 commit into
Conversation
Contributor
Author
|
@jakebailey mia culpa, this is another example of you adding stdlib support and me going back and trying to compile it out on bare metal. Maybe once #5903 lands the same magic can be applied for the synctest flag. |
davecheney
force-pushed
the
davecheney-synctest-compile-time-evaluation
branch
from
October 21, 2026 03:26
0b4f9c8 to
7539f48
Compare
davecheney
force-pushed
the
davecheney-synctest-compile-time-evaluation
branch
from
October 22, 2026 13:34
7539f48 to
1b0e5d6
Compare
jakebailey
approved these changes
Oct 22, 2026
jakebailey
left a comment
Member
There was a problem hiding this comment.
Seems okay I guess, just not sure how one would ever be in this situation
davecheney
force-pushed
the
davecheney-synctest-compile-time-evaluation
branch
from
October 23, 2026 13:57
1b0e5d6 to
65a3c95
Compare
Initialization in the time package and channel initialization call synctestIsEnabled even when the program does not use testing/synctest. The interpreter cannot evaluate its atomic load. On unicore targets, earlier runtime calls can also cause the ordinary load to be deferred because the state is marked as externally written. Disable synctest on bare-metal targets so that the enabled check can be evaluated at compile time. Hosted synctest support is unchanged. Attempts to start a synctest bubble on bare metal fail explicitly. For the time/channel/context fixture at -opt=1, linked firmware saves 128 bytes of flash and 8 bytes of static RAM on RP2040 unicore, and 80 bytes of flash and 8 bytes of static RAM on RP2350 cores. LLVM already removed the inactive remainder of the synctest logic later in the optimization pipeline. This change removes the earlier interpretation barrier, not an otherwise retained synctest engine.
davecheney
force-pushed
the
davecheney-synctest-compile-time-evaluation
branch
from
October 23, 2026 22:35
65a3c95 to
e29b812
Compare
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.
Initialization in the time package and channel initialization call synctestIsEnabled even when the program does not use testing/synctest. The interpreter cannot evaluate its atomic load. On unicore targets, earlier runtime calls can also cause the ordinary load to be deferred because the state is marked as externally written.
Disable synctest on bare-metal targets so that the enabled check can be evaluated at compile time. Hosted synctest support is unchanged. Attempts to start a synctest bubble on bare metal fail explicitly.
For the time/channel/context fixture at -opt=1, linked firmware saves 128 bytes of flash and 8 bytes of static RAM on RP2040 unicore, and 80 bytes of flash and 8 bytes of static RAM on RP2350 cores.
LLVM already removed the inactive remainder of the synctest logic later in the optimization pipeline. This change removes the earlier interpretation barrier, not an otherwise retained synctest engine.