Created
July 8, 2017 20:48
-
-
Save linknum23/a087cae9da70a402d12ac8d1e4688dec to your computer and use it in GitHub Desktop.
Set the optimization level of a single c function in gcc
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
// You can use a Function Attribute called optimize to do this. | |
// I got the info on Function Attributes from this link: | |
// https://gcc.gnu.org/onlinedocs/gcc-4.5.4/gcc/Function-Attributes.html#Function-Attributes | |
// To set the optimization level to -O0 for a function: | |
void __attribute__ ((optimize("-O0"))) foo() {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment