This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

When did 'pragma optimize' become available?


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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]