This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: When did 'pragma optimize' become available?
- From: Markus Trippelsdorf <markus at trippelsdorf dot de>
- To: Jeffrey Walton <noloader at gmail dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 13 Jul 2015 09:14:46 +0200
- Subject: Re: When did 'pragma optimize' become available?
- Authentication-results: sourceware.org; auth=none
- References: <CAH8yC8=UZqiqFce0sM7SDUh7E2Ru8LmfxdyBwFCosj5bcTiGjg at mail dot gmail dot com>
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