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]

Re: When did 'pragma optimize' become available?


On 2015.07.12 at 20:32 -0400, Jeffrey Walton wrote:
> 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
> 

This is a bad idea in general, because "pragma GCC optimize" is meant as
a compiler debugging aid only. It should _not_ be used in production
code. 
Please fix the underlying issue instead (, or open a bug for it).

-- 
Markus


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