This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: ARMv8, GCC 4.9 and necessary code optimized away?
- From: Jeffrey Walton <noloader at gmail dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 27 Jul 2017 02:58:54 -0400
- Subject: Re: ARMv8, GCC 4.9 and necessary code optimized away?
- Authentication-results: sourceware.org; auth=none
- References: <CAH8yC8=KPf7edhTRgKV4nVJfwMpSXwmU+PDGfL6i4xA4SDwJwQ@mail.gmail.com> <3f60c5b1-5114-3883-09a6-fe3c5a79410e@redhat.com>
- Reply-to: noloader at gmail dot com
On Mon, May 30, 2016 at 10:07 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 05/30/2016 06:00 AM, Jeffrey Walton wrote:
>
>> longjmp(s_jmpNoCRC32, 1);
>
>
> You should use siglongjmp and sigsetjmp.
>
>> uint32_t w=0, x=0; uint16_t y=0; uint8_t z=0;
>> w = __crc32cw(w,x);
>> w = __crc32ch(w,y);
>> w = __crc32cb(w,z);
>
>
> The final w value is never used. You need to make volatile, or otherwise
> ensure that the computation does not happen at compile time.
Sorry to dig up an old thread. This looks like a known bug that's kind
of being worked on: "C Compilers Disprove Fermat’s Last Theorem",
https://blog.regehr.org/archives/140.
Jeff