Created
September 20, 2023 09:59
-
-
Save ljmccarthy/2851666d839e945acb17a55aebc79b32 to your computer and use it in GitHub Desktop.
Run GCC with all optimisations disabled
This file contains 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
#!/bin/sh | |
GCC_O0_OPTS_DISABLED=$(gcc -Q -O0 --help=optimizers | awk -v ORS=" " '($1 ~ /^-f/) && ($2 ~ /enabled/) {print "-fno-" substr($1,3)}') | |
exec gcc -O0 $GCC_O0_OPTS_DISABLED "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment