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

            Bug ID: 112804
           Summary: ICE in aarch64 crosscompiler in plus_constant, at
                    explow.cc:102
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, needs-bisection
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fkastl at suse dot cz
  Target Milestone: ---
              Host: x86_64-linux
            Target: aarch64-gnu-linux

Created attachment 56748
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56748&action=edit
Log of found plus_constant ICEs

While compiling the gcc.dg/tree-ssa/pr111583-2.c testcase from GCC testsuite
using the aarch64 cross compiler with the following options:

aarch64-linux-gnu-gcc
/home/worker/buildworker/tiber-option-juggler/build/gcc/testsuite/gcc.dg/tree-ssa/pr111583-2.c
-mabi=ilp32 -finline-stringops -ftrivial-auto-var-init=zero

the following ICE occurs:

during RTL pass: expand
/home/worker/buildworker/tiber-option-juggler/build/gcc/testsuite/gcc.dg/tree-ssa/pr111583-2.c:
In function ‘m’:
/home/worker/buildworker/tiber-option-juggler/build/gcc/testsuite/gcc.dg/tree-ssa/pr111583-2.c:18:25:
internal compiler error: in plus_constant, at explow.cc:102
   18 |   const unsigned short *n[65];
      |                         ^
0x73fa6c plus_constant(machine_mode, rtx_def*, poly_int<2u, long>, bool)
       
/home/worker/buildworker/tiber-gcc-trunk-aarch64/build/gcc/explow.cc:102
0x89f52f try_store_by_multiple_pieces(rtx_def*, rtx_def*, unsigned int,
unsigned long, unsigned long, rtx_def*, char, unsigned int)
       
/home/worker/buildworker/tiber-gcc-trunk-aarch64/build/gcc/builtins.cc:4517
0x9d8870 clear_storage_hints(rtx_def*, rtx_def*, block_op_methods, unsigned
int, long, unsigned long, unsigned long, unsigned long, unsigned int)
        /home/worker/buildworker/tiber-gcc-trunk-aarch64/build/gcc/expr.cc:3888
0x8a619b expand_builtin_memset_args
       
/home/worker/buildworker/tiber-gcc-trunk-aarch64/build/gcc/builtins.cc:4674
0xac23f7 expand_DEFERRED_INIT
       
/home/worker/buildworker/tiber-gcc-trunk-aarch64/build/gcc/internal-fn.cc:3357
0x8c6a37 expand_call_stmt
       
/home/worker/buildworker/tiber-gcc-trunk-aarch64/build/gcc/cfgexpand.cc:2738
0x8c6a37 expand_gimple_stmt_1
       
/home/worker/buildworker/tiber-gcc-trunk-aarch64/build/gcc/cfgexpand.cc:3881
0x8c6a37 expand_gimple_stmt
       
/home/worker/buildworker/tiber-gcc-trunk-aarch64/build/gcc/cfgexpand.cc:4045
0x8cbac7 expand_gimple_basic_block
       
/home/worker/buildworker/tiber-gcc-trunk-aarch64/build/gcc/cfgexpand.cc:6101
0x8cd7be execute
       
/home/worker/buildworker/tiber-gcc-trunk-aarch64/build/gcc/cfgexpand.cc:6836
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


The same bug (the same stacktrace) occurs on these testcases:

aarch64-linux-gnu-gcc
/home/worker/buildworker/tiber-option-juggler/build/gcc/testsuite/gcc.target/aarch64/mops_4.c
-mabi=ilp32 -finline-stringops

aarch64-linux-gnu-gcc
/home/worker/buildworker/tiber-option-juggler/build/gcc/testsuite/gcc.dg/pr34457-1.c
-mabi=ilp32 -finline-stringops

aarch64-linux-gnu-gfortran
/home/worker/buildworker/tiber-option-juggler/build/gcc/testsuite/gfortran.dg/pr49308.f90
-finline-stringops -mabi=ilp32

aarch64-linux-gnu-gcc
/home/worker/buildworker/tiber-option-juggler/build/gcc/testsuite/gcc.dg/ubsan/bounds-4b.c
-finline-stringops -mabi=ilp32 -Os

aarch64-linux-gnu-gfortran
/home/worker/buildworker/tiber-option-juggler/build/gcc/testsuite/gfortran.dg/analyzer/deferred_character_25.f90
-mabi=ilp32 -finline-stringops


ICE in plus_constant (similar, but different stacktrace) also occurs here:

aarch64-linux-gnu-gcc
/home/worker/buildworker/tiber-option-juggler/build/gcc/testsuite/gcc.target/aarch64/test_frame_5.c
-mabi=ilp32 -ftrivial-auto-var-init=pattern -finline-stringops

aarch64-linux-gnu-gcc
/home/worker/buildworker/tiber-option-juggler/build/gcc/testsuite/gcc.target/aarch64/stack-check-prologue-15.c
-ftrivial-auto-var-init=pattern -mabi=ilp32 -finline-stringops

aarch64-linux-gnu-g++
/home/worker/buildworker/tiber-option-juggler/build/gcc/testsuite/g++.dg/vect/pr84362.cc
-ftrivial-auto-var-init=pattern -mabi=ilp32 -finline-stringops


There are many more testcases that currently produce an ICE in plus_constant.
I'm attaching a full log of the ICEs.


Configuration of the compiler:

Using built-in specs.
COLLECT_GCC=/home/worker/cross/bin/aarch64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/worker/cross/libexec/gcc/aarch64-linux-gnu/14.0.0/lto-wrapper
Target: aarch64-linux-gnu
Configured with:
/home/worker/buildworker/tiber-gcc-trunk-aarch64/build/configure
--enable-languages=c,c++,fortran,rust,m2 --disable-bootstrap
--disable-libsanitizer --disable-multilib --enable-checking=release
--prefix=/home/worker/cross --target=aarch64-linux-gnu
--with-as=/usr/bin/aarch64-suse-linux-as
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20231130 (experimental)
725c68c54c265fe7f6fc7babff7139f3161bdfa6 (GCC)

Reply via email to