Bug 59602 - ARM, __attribute__((interrupt("FIQ"))) causes internal compiler error with -O0
Summary: ARM, __attribute__((interrupt("FIQ"))) causes internal compiler error with -O0
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.8.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: ice-on-valid-code
Depends on:
Reported: 2013-12-26 13:21 UTC by Sergey Belyashov
Modified: 2014-02-05 21:08 UTC (History)
1 user (show)

See Also:
Target: arm
Known to work:
Known to fail:
Last reconfirmed: 2014-01-08 00:00:00


Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Belyashov 2013-12-26 13:21:10 UTC
I try to compile simple program. If I use some level of optimization more than zero then no problem. But without optimization compiler dies:

$ arm-none-eabi-gcc -O0 -marm -march=armv4 -nostdlib -std=gnu99 -c -o bootldr.o bootldr.c
bootldr.c: In function 'fiqHandler':
bootldr.c:5:1: error: insn does not satisfy its constraints:
(insn 13 12 14 (set (reg/f:SI 13 sp)
        (plus:SI (reg/f:SI 11 fp)
            (const_int 4 [0x4]))) bootldr.c:5 5 {*arm_addsi3}
bootldr.c:5:1: internal compiler error: in note_invalid_constants, at config/arm/arm.c:15751

$ cat bootldr.c
void fiqHandler(void) __attribute__ ((interrupt("FIQ")));
void fiqHandler(void)
    __asm__ volatile("nop");

$ arm-none-eabi-gcc -v
Using built-in specs.
Target: arm-none-eabi
Configured with: /build/buildd/gcc-arm-none-eabi-4-8-2013q4/src/gcc/configure --target=arm-none-eabi --prefix=/build/buildd/gcc-arm-none-eabi-4-8-2013q4/install-native --libexecdir=/build/buildd/gcc-arm-none-eabi-4-8-2013q4/install-native/lib --infodir=/build/buildd/gcc-arm-none-eabi-4-8-2013q4/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/build/buildd/gcc-arm-none-eabi-4-8-2013q4/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/build/buildd/gcc-arm-none-eabi-4-8-2013q4/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/build/buildd/gcc-arm-none-eabi-4-8-2013q4/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --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=/build/buildd/gcc-arm-none-eabi-4-8-2013q4/install-native/arm-none-eabi --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.8.3 20131129 (release) [ARM/embedded-4_8-branch revision 205641] (GNU Tools for ARM Embedded Processors) 

$ lsb_release -d
Description:	Ubuntu 12.04.3 LTS
Comment 1 Richard Earnshaw 2014-01-08 11:28:03 UTC
Not sure why anyone would want unoptimized FIQ code (read fast interrupts), but still a bug.

Has probably been broken since Thumb2 support was added.