https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115281
Bug ID: 115281 Summary: [14/15 Regression] aarch64 ICE in go_through_subreg after r14-5129 Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: rsandifo at gcc dot gnu.org CC: avieira at gcc dot gnu.org Target Milestone: --- Target: aarch64*-*-* The following test ICEs with -O3 -mcpu=neoverse-v1 after r14-5129 (thanks to Andre for the reproducer): SUBROUTINE fn0(ma, mb, nt) CHARACTER ca REAL r0(ma) INTEGER i0(mb) REAL r1(3,mb) REAL r2(3,mb) REAL r3(3,3) zero=0.0 do na = 1, nt nt = i0(na) do l = 1, 3 r1 (l, na) = r0 (nt) r2(l, na) = zero enddo enddo if (ca .ne.'z') then do j = 1, 3 do i = 1, 3 r4 = zero enddo enddo do na = 1, nt do k = 1, 3 do l = 1, 3 do m = 1, 3 r3 = r4 * v enddo enddo enddo do i = 1, 3 do k = 1, ifn (r3) enddo enddo enddo endif END The ICE is: internal compiler error: in go_through_subreg, at ira-conflicts.cc:234 0x161647f go_through_subreg gnu/src/gcc/gcc/ira-conflicts.cc:234 0x1616657 process_regs_for_copy gnu/src/gcc/gcc/ira-conflicts.cc:270 0x1616fe8 process_reg_shuffles gnu/src/gcc/gcc/ira-conflicts.cc:440 0x1617b1b add_insn_allocno_copies gnu/src/gcc/gcc/ira-conflicts.cc:510 0x1617bcc add_copies gnu/src/gcc/gcc/ira-conflicts.cc:527 0x1600bed ira_traverse_loop_tree(bool, ira_loop_tree_node*, void (*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*)) gnu/src/gcc/gcc/ira-build.cc:1802 0x1618b38 ira_build_conflicts() gnu/src/gcc/gcc/ira-conflicts.cc:819 0x1605eb6 ira_build() gnu/src/gcc/gcc/ira-build.cc:3508 0x15fafe9 ira gnu/src/gcc/gcc/ira.cc:5793 0x15fba7f execute gnu/src/gcc/gcc/ira.cc:6117 I think this is a mode mix-up in go_through_subreg: we should be testing the natural mode size of the REG that we're trying to split, rather than the mode of the result. (But we probably also need to handle paradoxical subregs separately.)