Bug 116325 - [lra] ICE: in curr_insn_transform, at lra-constraints.cc:4283
Summary: [lra] ICE: in curr_insn_transform, at lra-constraints.cc:4283
Status: RESOLVED DUPLICATE of bug 116326
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: build, ice-on-valid-code, ra
Depends on:
Blocks: avr+ra 113932 113934
  Show dependency treegraph
 
Reported: 2024-08-10 11:19 UTC by Georg-Johann Lay
Modified: 2024-09-18 09:49 UTC (History)
1 user (show)

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


Attachments
pr60040-2.c: GNU-C99 test case from gcc.target/avr (896 bytes, text/x-csrc)
2024-08-10 11:19 UTC, Georg-Johann Lay
Details
C++ test case from libstdc++v3 (94.78 KB, text/plain)
2024-08-17 13:31 UTC, Georg-Johann Lay
Details
qsort.c. C test case (965 bytes, text/plain)
2024-08-19 15:28 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-08-10 11:19:59 UTC
Created attachment 58897 [details]
pr60040-2.c: GNU-C99 test case from gcc.target/avr

$ avr-gcc pr60040-2.c -mlra -S -Os

/pr60040-2.c:112:1: error: unable to generate reloads for:
  112 | }
      | ^
(call_insn 44 43 45 3 (parallel [
            (set (reg:HI 24 r24)
                (call (mem:HI (reg/f:HI 79 [ ops_25(D)->blank ]) [0 *_26 S2 A8])
                    (const_int 0 [0])))
            (use (const_int 0 [0]))
        ]) "gcc.target/avr/pr60040-2.c":66:10 774 {call_value_insn}
     (expr_list:REG_DEAD (reg/f:HI 79 [ ops_25(D)->blank ])
        (expr_list:REG_DEAD (reg:SI 20 r20)
            (expr_list:REG_DEAD (reg:SI 16 r16)
                (expr_list:REG_DEAD (reg:SI 12 r12)
                    (expr_list:REG_DEAD (reg:SI 8 r8)
                        (expr_list:REG_UNUSED (reg:HI 24 r24)
                            (expr_list:REG_CALL_DECL (nil)
                                (nil))))))))
    (expr_list:HI (use (reg:HI 24 r24))
        (expr_list:SI (use (reg:SI 20 r20))
            (expr_list:SI (use (reg:SI 16 r16))
                (expr_list:SI (use (reg:SI 12 r12))
                    (expr_list:SI (use (reg:SI 8 r8))
                        (nil)))))))
during RTL pass: reload
gcc.target/avr/pr60040-2.c:112:1: internal compiler error: in curr_insn_transform, at lra-constraints.cc:4283

The insn in an indirect call, which should use the Z register (reg:HI 30) for the target address.

Target: avr
Configured with: ../../source/gcc-master/configure --target=avr --disable-nls --with-dwarf2 --with-gnu-as --with-gnu-ld --disable-shared --with-long-double=64 --enable-languages=c,c++
Comment 1 Georg-Johann Lay 2024-08-17 13:31:28 UTC
Created attachment 58945 [details]
C++ test case from libstdc++v3

This is a test case from libstdc++v3.  Compile with

$ avr-g++ pr116389.cpp -S -dumpbase "" -O2 -mmcu=avrtiny -dp -fdump-rtl-ira-details -fdump-rtl-reload-details -mlra

error: unable to generate reloads for:
(call_insn/j 43 42 44 8 (parallel [
            (set (reg:HI 24 r24)
                (call (mem:HI (reg/f:HI 45 [ _8 ]) [0 *OBJ_TYPE_REF(_8;this_1(D)->7B) S2 A8])
                    (const_int 2 [0x2])))
            (use (const_int 1 [0x1]))
        ]) "/ssd1/build/avr/gcc-bug/avr/avrtiny/libstdc++-v3/include/bits/locale_facets.h":917:23 774 {call_value_insn}
     (expr_list:REG_DEAD (reg/f:HI 45 [ _8 ])
        (expr_list:REG_DEAD (reg:QI 35 argH)
            (expr_list:REG_DEAD (reg:HI 22 r22)
                (expr_list:REG_DEAD (reg:HI 20 r20)
                    (expr_list:REG_UNUSED (reg:HI 24 r24)
                        (expr_list:REG_CALL_DECL (nil)
                            (nil)))))))
    (expr_list:HI (use (reg:HI 24 r24))
        (expr_list:HI (use (reg:HI 22 r22))
            (expr_list:HI (use (reg:HI 20 r20))
                (expr_list:HI (use (mem/f:HI (reg/f:HI 34 argL) [0  S2 A8]))
                    (nil))))))
during RTL pass: reload
dump file: pr116389.cpp.317r.reload
/ssd1/build/avr/gcc-bug/avr/avrtiny/libstdc++-v3/include/bits/locale_facets.h:918:7: internal compiler error: in curr_insn_transform, at lra-constraints.cc:4283
Comment 2 Georg-Johann Lay 2024-08-19 15:28:16 UTC
Created attachment 58958 [details]
qsort.c. C test case

LRA can't compile qsort.c from libc; same ICE.
Comment 3 Georg-Johann Lay 2024-08-19 15:47:22 UTC
(In reply to Georg-Johann Lay from comment #2)
> Created attachment 58958 [details]
> qsort.c. C test case
> 
> LRA can't compile qsort.c from libc; same ICE.

Just compile qsort.c with -mlra (optimizatio level and -mmcu don't seem to matter).
Comment 4 Georg-Johann Lay 2024-09-18 09:49:52 UTC
Dup of PR116326; at least the patch to resolve PR116326 also resolves the test cases for this PR.

*** This bug has been marked as a duplicate of bug 116326 ***