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

            Bug ID: 119127
           Summary: ICE in decompose, at rtl.h:2312 during RTL pass:
                    late_combine
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xen0n at gentoo dot org
                CC: chenglulu at loongson dot cn, xry111 at gcc dot gnu.org
  Target Milestone: ---
            Target: loongarch64-linux-gnu

Created attachment 60661
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60661&action=edit
Minimized reproducer

cvise-minimized reproducer attached. This is preventing me from building LLVM.
Interestingly -freport-bug does not work in this case.

$ g++ -O2 -pipe -march=loongarch64 -S -o /dev/null BypassSlowDivision.ii
during RTL pass: late_combine
BypassSlowDivision.ii: In constructor
‘FastDivInsertionTask::FastDivInsertionTask()’:
BypassSlowDivision.ii:12:1: internal compiler error: in decompose, at
rtl.h:2312
   12 | }
      | ^
0x7ffff27bd5c7 __libc_start_call_main
        ../sysdeps/nptl/libc_start_call_main.h:58
0x7ffff27bd6c7 __libc_start_main_impl
        ../csu/libc-start.c:360
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.

Observations:

* replacing -O2 with -O1 or -O0 makes the problem go away
* so does replacing the integer 37 with 36
* loongarch64-linux-gnu-g++-14 works

So I think this is likely due to some loongarch backend change in the GCC 15
cycle. I haven't tested with GCC 15 on other architectures at the moment
though.

Reply via email to