Function Specific Option Pragmas (Using the GNU Compiler Collection (GCC))

#### 6.5.16 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 treated as if it had been declared with one `target(`string`)` attribute for each string argument. The parentheses around the strings in the pragma are optional. See Common Attributes, for more information about the `target` attribute and the attribute syntax.

  The `#pragma GCC target` pragma is presently implemented for x86, ARM, AArch64, PowerPC, RISC-V, and S/390 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 treated as if it had been declared with one `optimize(`string`)` attribute for each string argument. The parentheses around the strings in the pragma are optional. See Common Attributes, for more information about the `optimize` 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.