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

Review all.sh for tests that use gcc or -O0 where they don't need to #151

Open
daverodgman opened this issue Jan 2, 2024 · 1 comment
Open
Labels
enhancement New feature or request priority-high size-s Estimated task size: small (~2d)

Comments

@daverodgman
Copy link
Contributor

daverodgman commented Jan 2, 2024

Probably many tests still use gcc (as opposed to clang) or -O0 (or nothing specified, as opposed to -O2), where there is not a particular reason to do so. Review for tests where we can improve this. Tests where we actually run output built with -O0 will have the most impact.

@daverodgman daverodgman added enhancement New feature or request size-s Estimated task size: small (~2d) priority-high labels Jan 2, 2024
@gilles-peskine-arm
Copy link
Contributor

-O0

We only test with -O0 once per compiler (and not for all compilers).

nothing specified, as opposed to -O2

For make, the default is -Os. For CMake, the default is -O0, but it's -O2 with CMAKE_BUILD_TYPE=Release, -O3 with CMAKE_BUILD_TYPE=Asan and -Os with CMAKE_BUILD_TYPE=Check. We almost always pass a build type to CMake in all.sh but there are a few exceptions and it's Check in a couple of places.

For build-only components, we should use -O1. (-O0 is faster, but misses some static analysis that GCC or Clang can perform.)

Arguably -Os should not be the default. It's what a lot of our users want (in the microcontroller space), but those users typically pass -Os explicitly anyway, because they know they want to optimize for size. Linux distributions and such are more likely to use default settings and would be better served by -O2 or -O3. But that's a separate debate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority-high size-s Estimated task size: small (~2d)
Projects
Status: CI perf
Development

No branches or pull requests

2 participants