internal compiler error in arm_cortex_v7m_branch_cost, at config/arm/arm.c:8761

Asked by Günter Fuchs

I am porting the crypto folder of Open_SSL 1.0.1 to a Cortex-M4 (Atmel SAM4S Xplained) board. I can build this folder using the Yagarto toolchain and run it. But building it with your latest toolchain fails with the error below:
________________________________________
GNU C (GNU Tools for ARM Embedded Processors) version 4.7.3 20121207 (release) [ARM/embedded-4_7-branch revision 194305] (arm-none-eabi)
 compiled by GNU C version 4.3.6, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: de394053dbf55c8655d4d034c9ddd45f
../src/tpm/open_ssl/crypto/stack/stack.c: In function 'sk_insert':
../src/tpm/open_ssl/crypto/stack/stack.c:157:2: internal compiler error: in arm_cortex_v7m_branch_cost, at config/arm/arm.c:8761
_______________________________________
The gcc input is:
make all
Building file: ../src/tpm/open_ssl/crypto/stack/stack.c
Using built-in specs.
Invoking: Cross GCC Compiler
~/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc -D__SAM4S16__ -DUSE_OSSL -DBOARD=SAM4S_XPLAINED -DARM_MATH_CM4=true -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/config" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/tpm/include" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/tpm/include/openssl" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/tpm/open_ssl" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/tpm/open_ssl/crypto" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/common/boards" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/common/utils" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/common/utils/stdio/stdio_serial" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/common/services/clock" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/common/services/gpio" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/common/services/serial" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/common/services/serial/sam_uart" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/sam/boards" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/sam/boards/sam4s_xplained" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/sam/drivers/pio" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/sam/drivers/pmc" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/sam/drivers/rtt" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/sam/drivers/spi" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/sam/drivers/uart" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/sam/drivers/usart" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/sam/utils" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/sam/utils/preprocessor" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/sam/utils/header_files" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/sam/utils/cmsis/sam4s/include" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/sam/utils/cmsis/sam4s/source/templates" -I"/home/gfuchs/workspace_gfuchs/OpenSSL_SAM4S/src/asf/thirdparty/CMSIS/Lib/GCC" -O1 -ffunction-sections -mlong-calls -g -Wall -Wextra -c -fmessage-length=0 -mtune=cortex-m4 -mthumb -v -MMD -MP -MF"src/tpm/open_ssl/crypto/stack/stack.d" -MT"src/tpm/open_ssl/crypto/stack/stack.d" -o "src/tpm/open_ssl/crypto/stack/stack.o" "../src/tpm/open_ssl/crypto/stack/stack.c"
COLLECT_GCC=/home/gfuchs/gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc
Target: arm-none-eabi
Configured with: /home/build/work/GCC-4-7-build/src/gcc/configure --target=arm-none-eabi --prefix=/home/build/work/GCC-4-7-build/install-native --libexecdir=/home/build/work/GCC-4-7-build/install-native/lib --infodir=/home/build/work/GCC-4-7-build/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/home/build/work/GCC-4-7-build/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/home/build/work/GCC-4-7-build/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/home/build/work/GCC-4-7-build/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-lto --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/home/build/work/GCC-4-7-build/install-native/arm-none-eabi --build=i686-linux-gnu --host=i686-linux-gnu --with-gmp=/home/build/work/GCC-4-7-build/build-native/host-libs/usr --with-mpfr=/home/build/work/GCC-4-7-build/build-native/host-libs/usr --with-mpc=/home/build/work/GCC-4-7-build/build-native/host-libs/usr --with-ppl=/home/build/work/GCC-4-7-build/build-native/host-libs/usr --with-cloog=/home/build/work/GCC-4-7-build/build-native/host-libs/usr --with-libelf=/home/build/work/GCC-4-7-build/build-native/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors' --with-multilib-list=armv6-m,armv7-m,armv7e-m,armv7-r
Thread model: single
gcc version 4.7.3 20121207 (release) [ARM/embedded-4_7-branch revision 194305] (GNU Tools for ARM Embedded Processors)

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
chengbin (can-finner) said :
#1

Hi,
This should be a bug in GCC and we will follow up this issue.
For now, you can simple walk around by replacing "-mthumb -mtune=cortex-m4" with "-mthumb -mcpu=cortex-m4".
Hoping this can help. Thanks.

Revision history for this message
chengbin (can-finner) said :
#2

s/simple/simply/

Revision history for this message
chengbin (can-finner) said :
#3

Hi,
I think this issue will be handled in the next update release.
But as quoted from gcc manual, "This option is very similar to the ‘-mcpu=’ option, except that instead of specifying the actual target processor type, and hence restricting which instructions can be used, it specifies that GCC should tune the performance of the code as if the target were of the type specified in this option, but still choosing the instructions that it will generate based on the CPU specified by a ‘-mcpu=’option."

which means -mtune=... is not equal to -mcpu=...
So if you want to generate code for cortex-m4, you need specify -mcpu=cortex-m4 explicitly.

Thanks.

Revision history for this message
Joey Ye (jinyun-ye) said :
#4

Fixed and released in 4.7 2013q2 update

Can you help with this problem?

Provide an answer of your own, or ask Günter Fuchs for more information if necessary.

To post a message you must log in.