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

            Bug ID: 119355
           Summary: ICE / assertion in "during RTL pass: avr-fuse-move"
                    for avr-linux cross-compiler
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dan at danny dot cz
  Target Milestone: ---

Created attachment 60803
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60803&action=edit
preprocessed source

Building libgcc for the avr-linux target throws an ICE / assertion. The host is
Fedora 40 ppc64le for me, but as
https://koji.fedoraproject.org/koji/taskinfo?taskID=130394432 shows, it fails
everywhere. Seems the target compiler needs to built with
"-Wp,-D_GLIBCXX_ASSERTIONS".

[dan@talos libgcc]$ /mnt/dan/gcc-15.0.1-20250313/avr32-linux/./gcc/xgcc
-B/mnt/dan/gcc-15.0.1-20250313/avr32-linux/./gcc/ -B/usr/local/avr-linux/bin/ 
-B/usr/local/avr-linux/lib/avr25/ -isystem /usr/local/avr-linux/include
-isystem /usr/local/avr-linux/sys-include    -g -O2 -Wall -fexceptions
-mmcu=avr25 -O2  -g -O2 -Wall -fexceptions -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE
 -W -Wall -Wno-error=narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include  -Dinhibit_libc
-mcall-prologues -Os -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector
-Dinhibit_libc -Dinhibit_libc -mcall-prologues -Os -I. -I. -I../../.././gcc
-I../../../../libgcc -I../../../../libgcc/. -I../../../../libgcc/../gcc
-I../../../../libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS  -o _clrsbdi.o -MT
_clrsbdi.o -MD -MP -MF _clrsbdi.dep -DL__clrsbdi -DL_LABEL=_clrsbdi -DL_clrsb \
        -c ../../../../libgcc/config/avr/lib2funcs.c -fvisibility=hidden
-DHIDE_EXPORTS
/usr/include/c++/14/array:208: std::array<_Tp, _Nm>::value_type&
std::array<_Tp, _Nm>::operator[](size_type) [with _Tp = unsigned char; long
unsigned int _Nm = 32; reference = unsigned char&; size_type = long unsigned
int]: Assertion '__n < this->size()' failed.
during RTL pass: avr-fuse-move
../../../../libgcc/config/avr/lib2funcs.c: In function ‘__clrsbdi2’:
../../../../libgcc/config/avr/lib2funcs.c:164:1: internal compiler error:
Neúspěšně ukončen (SIGABRT)
  164 | }
      | ^
0x12150e1f internal_error(char const*, ...)
        ../../gcc/diagnostic-global-context.cc:517
0x10d1b523 crash_signal
        ../../gcc/toplev.cc:322
0x1143ac1f std::array<unsigned char, 32ul>::operator[](unsigned long)
        /usr/include/c++/14/array:208
0x1143ac1f std::array<unsigned char, 32ul>::operator[](unsigned long)
        /usr/include/c++/14/array:206
0x1143ac1f apply
        ../../gcc/config/avr/avr-passes.cc:2202
0x11441eab find_plies
        ../../gcc/config/avr/avr-passes.cc:2380
0x11443b6f find_plies
        ../../gcc/config/avr/avr-passes.cc:2437
0x114444b7 run_find_plies
        ../../gcc/config/avr/avr-passes.cc:2509
0x11447b6b try_split_ldi
        ../../gcc/config/avr/avr-passes.cc:2699
0x11447b6b optimize_one_block
        ../../gcc/config/avr/avr-passes.cc:3155
0x1144a7ab optimize_one_function
        ../../gcc/config/avr/avr-passes.cc:3264
0x1144a7ab execute
        ../../gcc/config/avr/avr-passes.cc:1243
0x1144a7ab execute
        ../../gcc/config/avr/avr-passes.cc:1236
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.


PS: please ignore the avr32 prefix, it's a packaging oddity in Fedora, should
be just avr

Reply via email to