Bug in sha512 digest with -march=native -mtune=native -m64

NIIBE Yutaka gniibe at fsij.org
Wed Jun 19 05:00:02 CEST 2013

On 2013-06-18 at 23:24 +0900, Remko van der Vossen wrote:
> CFLAGS = -march=native -mtune=native -m64 -pipe -O3 -Wall -Wno-pointer-sign
> Running gcc 4.6.3
> Has anybody reproduced the failure?

I tested on Debian wheezy with gcc-4.6, which is:

   gcc-4.6 (Debian 4.6.3-14) 4.6.3

I did:

   $ CC=gcc-4.6 CFLAGS="-g -O3 -m64 -mtune=native -march=native" ./configure
   $ make

Then, generated GPG got "Illegal instruction" at "andn" instruction.
It doesn't work.

I did again avoiding bmi1 feature:

   $ CC=gcc-4.6 CFLAGS="-g -O3 -m64 -mtune=native -march=native -mno-bmi" ./configure
   $ make
   $ make check

Then, it works fine, as well as sha512 for "test\n".

The machine is virtual environment, so it could be some bug there.

vendor_id	: AuthenticAMD
cpu family	: 6
model		: 2
model name	: QEMU Virtual CPU version 1.1.2
stepping	: 3
microcode	: 0x1000065

More information about the Gnupg-devel mailing list