Bug 113098 - [14 Regression] LRA ICE building glibc for mips
Summary: [14 Regression] LRA ICE building glibc for mips
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 14.0
: P3 normal
Target Milestone: 14.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2023-12-20 20:31 UTC by Joseph S. Myers
Modified: 2024-01-12 23:52 UTC (History)
1 user (show)

See Also:
Host:
Target: mips*-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2024-01-12 00:00:00


Attachments
preprocessed source (6.86 KB, text/plain)
2023-12-20 20:31 UTC, Joseph S. Myers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph S. Myers 2023-12-20 20:31:03 UTC
Created attachment 56912 [details]
preprocessed source

Compile the attached code, from glibc, with -mabi=32 -O2 for MIPS (I used a mips64-linux-gnu compiler configured --with-mips-plt --with-nan=2008 --with-arch-64=mips64r2 --with-arch-32=mips32r2; the --with-arch-32 part may well be required to reproduce the issue).

offtime.c: In function '__offtime':
offtime.c:86:1: error: unable to find a register to spill
offtime.c:86:1: error: this is the insn:
(insn 1015 3973 3974 24 (parallel [
            (set (reg:SI 2971)
                (plus:SI (mult:SI (reg:SI 2367)
                        (reg:SI 898))
                    (reg:SI 2972)))
            (clobber (reg:SI 2881 [2814]))
            (clobber (reg:SI 2815))
        ]) "offtime.c":67:84 42 {*mul_acc_si}
     (expr_list:REG_UNUSED (reg:SI 2815)
        (expr_list:REG_UNUSED (reg:SI 2881 [2814])
            (expr_list:REG_DEAD (reg:SI 2972)
                (expr_list:REG_DEAD (reg:SI 2367)
                    (expr_list:REG_DEAD (reg:SI 898)
                        (nil)))))))
during RTL pass: reload
offtime.c:86:1: internal compiler error: in lra_split_hard_reg_for, at lra-assigns.cc:1862
0x6f3f05 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
        /scratch/jmyers/glibc/many14/src/gcc/gcc/rtl-error.cc:108
0xd53048 lra_split_hard_reg_for()
        /scratch/jmyers/glibc/many14/src/gcc/gcc/lra-assigns.cc:1862
0xd4c9c9 lra(_IO_FILE*, int)
        /scratch/jmyers/glibc/many14/src/gcc/gcc/lra.cc:2518
0xd00d97 do_reload
        /scratch/jmyers/glibc/many14/src/gcc/gcc/ira.cc:5973
0xd00d97 execute
        /scratch/jmyers/glibc/many14/src/gcc/gcc/ira.cc:6161
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.

ICE introduced by

commit 989e67f827b74b76e58abe137ce12d948af2290c
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Mon Dec 18 17:12:23 2023 -0500

    [PR112918][LRA]: Fixing IRA ICE on m68k
    
    Some GCC tests on m68K port of LRA is failed on `maximum number of
    generated reload insns per insn achieved`.  The problem is in that for
    subreg reload LRA can not narrow reg class more from ALL_REGS to
    GENERAL_REGS and then to data regs or address regs.  The patch permits
    narowing reg class from reload insns if this results in succesful
    matching of reg operand.
Comment 1 Vladimir Makarov 2023-12-21 14:42:34 UTC
The patch causing this was reverted.
Comment 2 Andrew Pinski 2023-12-21 16:00:05 UTC
Patch was reverted so fixed.
Comment 3 Joseph S. Myers 2024-01-12 23:51:00 UTC
This ICE building glibc has come back with the new fix for bug 112918 (not bisected, just presuming that commit is the cause, but it seems very likely).

Note: the arc ICE observed with the previous reverted fix for bug 112918 (bug 113097) has *not* come back.
Comment 4 Andrew Pinski 2024-01-12 23:52:58 UTC
Note it was already filed as PR 113354.