This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
When did 'pragma optimize' become available?
- From: Jeffrey Walton <noloader at gmail dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Sun, 12 Jul 2015 20:32:11 -0400
- Subject: When did 'pragma optimize' become available?
- Authentication-results: sourceware.org; auth=none
- Reply-to: noloader at gmail dot com
I've got a crash under GCC 4.9/x86_64 when using -O3. (The crash is
related to an array that's 64-bit aligned, but GCC selects the vmovdqa
instruction, which has 128-bit alignment requirements.)
It was easy enough to back-off optimizations:
#pragma GCC optimize push
#pragma GCC optimize ("-O2")
void xorbuf(byte *buf, const byte *mask, size_t count)
{
...
}
#pragma GCC optimize pop
However, I need to guard it for non-GCC compilers and down-level
version of GCC, like 4.2.1 (still used on OpenBSD). Compiling with
-Wall is a mess, otherwise.
The man page on pragma optimize does not offer a "first available in
...". Cf., https://gcc.gnu.org/onlinedocs/gcc/Function-Specific-Option-Pragmas.html.
When did 'pragma optimize' become available?