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

            Bug ID: 97205
           Summary: arm: Compiler fails with an ICE for -O0 on Trunk and
                    GCC-10 for _Generic feature.
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sripar01 at gcc dot gnu.org
  Target Milestone: ---
            Target: arm

Created attachment 49270
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49270&action=edit
testcase

Nested _Generic feature generating ICE with -O0 on GCC Trunk and GCC-10.

$arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=/arm/pdtl/builds/fsf-trunk.2226/installed/rhe6x86_64/arm-none-eabi/bin/arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/arm/pdtl/builds/fsf-trunk.2226/installed/rhe6x86_64/arm-none-eabi/bin/../libexec/gcc/arm-none-eabi/11.0.0/lto-wrapper
Target: arm-none-eabi
Configured with:
/tmp/dgboter/bbs/rhev-vm5--rhe6x86_64/buildbot/rhe6x86_64--arm-none-eabi/build/src/gcc/configure
--target=arm-none-eabi
--prefix=/tmp/dgboter/bbs/rhev-vm5--rhe6x86_64/buildbot/rhe6x86_64--arm-none-eabi/build/build-arm-none-eabi/install//
--with-gmp=/tmp/dgboter/bbs/rhev-vm5--rhe6x86_64/buildbot/rhe6x86_64--arm-none-eabi/build/build-arm-none-eabi/host-tools
--with-mpfr=/tmp/dgboter/bbs/rhev-vm5--rhe6x86_64/buildbot/rhe6x86_64--arm-none-eabi/build/build-arm-none-eabi/host-tools
--with-mpc=/tmp/dgboter/bbs/rhev-vm5--rhe6x86_64/buildbot/rhe6x86_64--arm-none-eabi/build/build-arm-none-eabi/host-tools
--with-isl=/tmp/dgboter/bbs/rhev-vm5--rhe6x86_64/buildbot/rhe6x86_64--arm-none-eabi/build/build-arm-none-eabi/host-tools
--disable-shared --disable-nls --disable-threads --disable-tls
--enable-checking=yes --enable-languages=c,c++,fortran --with-newlib
--with-multilib-list=aprofile --with-pkgversion=fsf-trunk.2226
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20200609 (experimental) (fsf-trunk.2226)

$ cat x.c
int a;
typedef __attribute__((aligned(2))) int x;
int fn1() {
  x b = ({
    _Generic(_Generic(fn1, default : a), int : _Generic(fn1, default : a));
  });
 return b;
}

$ arm-none-eabi-gcc  x.c -O0 -c -Wall -Werror
during RTL pass: expand
x.c: In function 'fn1':
x.c:4:5: internal compiler error: in gen_movsi, at config/arm/arm.md:6364
    4 |   x b = ({
      |     ^
0x1516e1d gen_movsi(rtx_def*, rtx_def*)
       
/tmp/dgboter/bbs/rhev-vm5--rhe6x86_64/buildbot/rhe6x86_64--arm-none-eabi/build/src/gcc/gcc/config/arm/arm.md:6364
0x925ddf insn_gen_fn::operator()(rtx_def*, rtx_def*) const
       
/tmp/dgboter/bbs/rhev-vm5--rhe6x86_64/buildbot/rhe6x86_64--arm-none-eabi/build/src/gcc/gcc/recog.h:317
0x925ddf emit_move_insn_1(rtx_def*, rtx_def*)
       
/tmp/dgboter/bbs/rhev-vm5--rhe6x86_64/buildbot/rhe6x86_64--arm-none-eabi/build/src/gcc/gcc/expr.c:3759
0x926872 emit_move_insn(rtx_def*, rtx_def*)
       
/tmp/dgboter/bbs/rhev-vm5--rhe6x86_64/buildbot/rhe6x86_64--arm-none-eabi/build/src/gcc/gcc/expr.c:3929
0x92ef96 store_expr(tree_node*, rtx_def*, int, bool, bool)
       
/tmp/dgboter/bbs/rhev-vm5--rhe6x86_64/buildbot/rhe6x86_64--arm-none-eabi/build/src/gcc/gcc/expr.c:6038
0x93172e expand_assignment(tree_node*, tree_node*, bool)
       
/tmp/dgboter/bbs/rhev-vm5--rhe6x86_64/buildbot/rhe6x86_64--arm-none-eabi/build/src/gcc/gcc/expr.c:5588
0x7dd4bc expand_gimple_stmt_1
       
/tmp/dgboter/bbs/rhev-vm5--rhe6x86_64/buildbot/rhe6x86_64--arm-none-eabi/build/src/gcc/gcc/cfgexpand.c:3751
0x7dd4bc expand_gimple_stmt
       
/tmp/dgboter/bbs/rhev-vm5--rhe6x86_64/buildbot/rhe6x86_64--arm-none-eabi/build/src/gcc/gcc/cfgexpand.c:3847
0x7dfd75 expand_gimple_basic_block
       
/tmp/dgboter/bbs/rhev-vm5--rhe6x86_64/buildbot/rhe6x86_64--arm-none-eabi/build/src/gcc/gcc/cfgexpand.c:5888
0x7e0c7e execute
       
/tmp/dgboter/bbs/rhev-vm5--rhe6x86_64/buildbot/rhe6x86_64--arm-none-eabi/build/src/gcc/gcc/cfgexpand.c:6572
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Reply via email to