6.61.15 Function Specific Option Pragmas
#pragma GCC target ("string"...)
-
This pragma allows you to set target specific options for functions defined later in the source file. One or more strings can be specified. Each function that is defined after this point is as if
attribute((target("STRING")))
was specified for that function. The parenthesis around the options is optional. See Function Attributes, for more information about thetarget
attribute and the attribute syntax.The
#pragma GCC target
pragma is presently implemented for x86, ARM, AArch64, PowerPC, S/390, and Nios II targets only. #pragma GCC optimize ("string"...)
-
This pragma allows you to set global optimization options for functions defined later in the source file. One or more strings can be specified. Each function that is defined after this point is as if
attribute((optimize("STRING")))
was specified for that function. The parenthesis around the options is optional. See Function Attributes, for more information about theoptimize
attribute and the attribute syntax. #pragma GCC push_options
#pragma GCC pop_options
-
These pragmas maintain a stack of the current target and optimization options. It is intended for include files where you temporarily want to switch to using a different ‘#pragma GCC target’ or ‘#pragma GCC optimize’ and then to pop back to the previous options.
#pragma GCC reset_options
-
This pragma clears the current
#pragma GCC target
and#pragma GCC optimize
to use the default switches as specified on the command line.
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-8.3.0/gcc/Function-Specific-Option-Pragmas.html