Adjust -fsanitize=address,undefined test optimisation level and fix warnings#2109
Merged
Merged
Conversation
Enabling sanitizers leads to long compilation times at high optimisation levels. Testing shows that with the sanitizers, changing from "-O3" to "-Og" makes almost no difference to the "make test" time, but gives a significantly faster build. On a local machine, the total times for "make -j 3 && make test" were: | Setting | Time | | ------: | --------: | | -O3 | 6m13.677s | | -O2 | 5m11.763s | | -Os | 4m11.703s | | -Og | 3m24.097s | In all cases "make test" took around 2m10s +/- 2s.
These turn up at low optimisation levels, where the compiler isn't so good at working out that the variables do get set before use. Silence by making this more obvious.
Member
Author
|
.. and add |
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.
Enabling sanitizers leads to long compilation times at high optimisation levels. Testing shows that with the sanitizers, changing from
-O3to-Ogmakes almost no difference to themake testtime, but gives a significantly faster build.On a local machine, the total times for
make -j 3 && make testwere:In all cases
make testtook around 2m10s +/- 2s.Using this lower optimisation level triggers a couple of "may be used uninitialized" warnings, where the compiler isn't able to work out that they are actually always set before use. These are silenced by making it more obvious that they are set.