[Bug c/77494] New: -mcpu=cortex-a53 does not allow use of crc extensions

buzz at exotica dot org.uk gcc-bugzilla@gcc.gnu.org
Mon Sep 5 23:29:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77494

            Bug ID: 77494
           Summary: -mcpu=cortex-a53 does not allow use of crc extensions
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: buzz at exotica dot org.uk
  Target Milestone: ---

Tested with gcc 4.9.2 and gcc 5.1.0 on Raspbian on a Raspberry Pi 3

According to what I have read (eg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72736#c3) -mcpu=cortex-53 should
enable the crc extensions. However it doesn't seem to be working - or at least
AS is refusing to assemble the resulting asm code with -mcpu=cortex-a53 set.

example code

https://gist.github.com/gizmo98/8a83aef820f1e6d15da4a4baf3b7e0dc

Compiles fine with

gcc crctest.c -o testapp -std=c11 -march=armv8-a+crc
-mfpu=crypto-neon-fp-armv8" 

Fails with

gcc crctest.c -o testapp -std=c11 -mcpu=cortex-a53 -mfpu=crypto-neon-fp-armv8" 

Output logs:

Working:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 4.9.2-10'
--with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.9 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm
--disable-libquadmath --enable-plugin --with-system-zlib
--disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf
--with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6
--with-fpu=vfp --with-float=hard --enable-checking=release
--build=arm-linux-gnueabihf --host=arm-linux-gnueabihf
--target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.2 (Raspbian 4.9.2-10) 
COLLECT_GCC_OPTIONS='-v' '-o' 'testapp' '-std=c11' '-march=armv8-a+crc'
'-mfpu=crypto-neon-fp-armv8' '-mfloat-abi=hard' '-mtls-dialect=gnu'
 /usr/lib/gcc/arm-linux-gnueabihf/4.9/cc1 -quiet -v -imultilib . -imultiarch
arm-linux-gnueabihf crctest.c -quiet -dumpbase crctest.c -march=armv8-a+crc
-mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard -mtls-dialect=gnu -auxbase crctest
-std=c11 -version -o /tmp/ccmEUvHb.s
GNU C (Raspbian 4.9.2-10) version 4.9.2 (arm-linux-gnueabihf)
        compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version
3.1.2-p3, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=80 --param ggc-min-heapsize=94109
ignoring nonexistent directory "/usr/local/include/arm-linux-gnueabihf"
ignoring nonexistent directory
"/usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/arm-linux-gnueabihf/4.9/include
 /usr/local/include
 /usr/lib/gcc/arm-linux-gnueabihf/4.9/include-fixed
 /usr/include/arm-linux-gnueabihf
 /usr/include
End of search list.
GNU C (Raspbian 4.9.2-10) version 4.9.2 (arm-linux-gnueabihf)
        compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version
3.1.2-p3, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=80 --param ggc-min-heapsize=94109
Compiler executable checksum: 91c450f0e3805f97e63eb93bcfb4f682
COLLECT_GCC_OPTIONS='-v' '-o' 'testapp' '-std=c11' '-march=armv8-a+crc'
'-mfpu=crypto-neon-fp-armv8' '-mfloat-abi=hard' '-mtls-dialect=gnu'
 as -v -march=armv8-a+crc -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 -meabi=5
-o /tmp/ccKmRXnt.o /tmp/ccmEUvHb.s
GNU assembler version 2.25 (arm-linux-gnueabihf) using BFD version (GNU
Binutils for Raspbian) 2.25
COMPILER_PATH=/usr/lib/gcc/arm-linux-gnueabihf/4.9/:/usr/lib/gcc/arm-linux-gnueabihf/4.9/:/usr/lib/gcc/arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/4.9/:/usr/lib/gcc/arm-linux-gnueabihf/
LIBRARY_PATH=/usr/lib/gcc/arm-linux-gnueabihf/4.9/:/usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../:/lib/arm-linux-gnueabihf/:/lib/:/usr/lib/arm-linux-gnueabihf/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'testapp' '-std=c11' '-march=armv8-a+crc'
'-mfpu=crypto-neon-fp-armv8' '-mfloat-abi=hard' '-mtls-dialect=gnu'
 /usr/lib/gcc/arm-linux-gnueabihf/4.9/collect2 -plugin
/usr/lib/gcc/arm-linux-gnueabihf/4.9/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper
-plugin-opt=-fresolution=/tmp/cc4iQaOJ.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/
--build-id --eh-frame-hdr -dynamic-linker /lib/ld-linux-armhf.so.3 -X
--hash-style=gnu -m armelf_linux_eabi -o testapp
/usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/crt1.o
/usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/crti.o
/usr/lib/gcc/arm-linux-gnueabihf/4.9/crtbegin.o
-L/usr/lib/gcc/arm-linux-gnueabihf/4.9
-L/usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf
-L/usr/lib/gcc/arm-linux-gnueabihf/4.9/../../.. -L/lib/arm-linux-gnueabihf
-L/usr/lib/arm-linux-gnueabihf /tmp/ccKmRXnt.o -lgcc --as-needed -lgcc_s
--no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
/usr/lib/gcc/arm-linux-gnueabihf/4.9/crtend.o
/usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/crtn.o

Failed:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 4.9.2-10'
--with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.9 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm
--disable-libquadmath --enable-plugin --with-system-zlib
--disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf
--with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6
--with-fpu=vfp --with-float=hard --enable-checking=release
--build=arm-linux-gnueabihf --host=arm-linux-gnueabihf
--target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.2 (Raspbian 4.9.2-10) 
COLLECT_GCC_OPTIONS='-v' '-o' 'testapp' '-std=c11' '-mcpu=cortex-a53'
'-mfpu=crypto-neon-fp-armv8' '-mfloat-abi=hard' '-mtls-dialect=gnu'
 /usr/lib/gcc/arm-linux-gnueabihf/4.9/cc1 -quiet -v -imultilib . -imultiarch
arm-linux-gnueabihf crctest.c -quiet -dumpbase crctest.c -mcpu=cortex-a53
-mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard -mtls-dialect=gnu -auxbase crctest
-std=c11 -version -o /tmp/ccPqt2gE.s
GNU C (Raspbian 4.9.2-10) version 4.9.2 (arm-linux-gnueabihf)
        compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version
3.1.2-p3, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=80 --param ggc-min-heapsize=94109
ignoring nonexistent directory "/usr/local/include/arm-linux-gnueabihf"
ignoring nonexistent directory
"/usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/arm-linux-gnueabihf/4.9/include
 /usr/local/include
 /usr/lib/gcc/arm-linux-gnueabihf/4.9/include-fixed
 /usr/include/arm-linux-gnueabihf
 /usr/include
End of search list.
GNU C (Raspbian 4.9.2-10) version 4.9.2 (arm-linux-gnueabihf)
        compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version
3.1.2-p3, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=80 --param ggc-min-heapsize=94109
Compiler executable checksum: 91c450f0e3805f97e63eb93bcfb4f682
COLLECT_GCC_OPTIONS='-v' '-o' 'testapp' '-std=c11' '-mcpu=cortex-a53'
'-mfpu=crypto-neon-fp-armv8' '-mfloat-abi=hard' '-mtls-dialect=gnu'
 as -v -mcpu=cortex-a53 -mfloat-abi=hard -mfpu=crypto-neon-fp-armv8 -meabi=5 -o
/tmp/ccyHlfFo.o /tmp/ccPqt2gE.s
GNU assembler version 2.25 (arm-linux-gnueabihf) using BFD version (GNU
Binutils for Raspbian) 2.25
/tmp/ccPqt2gE.s: Assembler messages:
/tmp/ccPqt2gE.s:210: Error: selected processor does not support ARM mode
`crc32w r1,r3,r2'
/tmp/ccPqt2gE.s:219: Error: selected processor does not support ARM mode
`crc32w r3,r3,r2'
/tmp/ccPqt2gE.s:243: Error: selected processor does not support ARM mode
`crc32w r3,r3,r2'
/tmp/ccPqt2gE.s:262: Error: selected processor does not support ARM mode
`crc32h r3,r3,r2'
/tmp/ccPqt2gE.s:282: Error: selected processor does not support ARM mode
`crc32b r3,r3,r2'
/tmp/ccPqt2gE.s:321: Error: selected processor does not support ARM mode
`crc32h r3,r3,r2'


More information about the Gcc-bugs mailing list