Bug 116781 - [lra][avr] internal compiler error: in cselib_invalidate_regno, at cselib.cc:2545
Summary: [lra][avr] internal compiler error: in cselib_invalidate_regno, at cselib.cc:...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 15.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, ra
Depends on:
Blocks: 56183 113934
  Show dependency treegraph
 
Reported: 2024-09-19 13:15 UTC by Georg-Johann Lay
Modified: 2024-09-19 13:16 UTC (History)
1 user (show)

See Also:
Host:
Target: avr
Build:
Known to work:
Known to fail:
Last reconfirmed: 2024-09-19 00:00:00


Attachments
pr45830.c: C test case (635 bytes, text/x-csrc)
2024-09-19 13:15 UTC, Georg-Johann Lay
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Georg-Johann Lay 2024-09-19 13:15:28 UTC
Created attachment 59149 [details]
pr45830.c: C test case

This ICE does not occur with the old reload (-mno-lra):

$ avr-gcc pr45830.c -S -mlra -O2 -funroll-loops
during RTL pass: postreload
pr45830.c: In function 'bar':
pr45830.c:79:1: internal compiler error: in cselib_invalidate_regno, at cselib.cc:2545
   79 | }
      | ^
0x62b4a3 cselib_invalidate_regno
	../../../source/gcc-master/gcc/cselib.cc:2545
0x62b8f7 cselib_invalidate_rtx(rtx_def*)
	../../../source/gcc-master/gcc/cselib.cc:2699
0x62b938 cselib_invalidate_rtx_note_stores
	../../../source/gcc-master/gcc/cselib.cc:2710
0x62c87c cselib_record_sets
	../../../source/gcc-master/gcc/cselib.cc:3037
0x62d00d cselib_process_insn(rtx_insn*)
	../../../source/gcc-master/gcc/cselib.cc:3194
0x7f083a10ed8f __libc_start_call_main
	../sysdeps/nptl/libc_start_call_main.h:58
0x7f083a10ee3f __libc_start_main_impl
	../csu/libc-start.c:392

The respective lines in cselib.cc read:

cselib_invalidate_regno (unsigned int regno, machine_mode mode)
{
  unsigned int endregno;
  unsigned int i;

  /* If we see pseudos after reload, something is _wrong_.  */
  gcc_assert (!reload_completed || regno < FIRST_PSEUDO_REGISTER
	      || reg_renumber[regno] < 0);

Target: avr
Configured with: ../../source/gcc-master/configure --target=avr --disable-nls --with-dwarf2 --with-gnu-as --with-gnu-ld --disable-shared --enable-languages=c,c++
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240918 (experimental) (GCC)