Bug 104447 - [11 Regression] ICE: maximum number of LRA assignment passes is achieved (30)
Summary: [11 Regression] ICE: maximum number of LRA assignment passes is achieved (30)
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 12.0
: P2 normal
Target Milestone: 11.5
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code, inline-asm, ra
Depends on:
Blocks:
 
Reported: 2022-02-08 19:42 UTC by G. Steinmetz
Modified: 2024-03-11 04:35 UTC (History)
4 users (show)

See Also:
Host:
Target: x86_64-pc-linux-gnu
Build:
Known to work: 7.5.0
Known to fail: 8.1.0
Last reconfirmed: 2022-02-09 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description G. Steinmetz 2022-02-08 19:42:27 UTC
With versions r8+ and file ./gcc.target/i386/pr55512-4.c :


$ gcc-12-20220206 -c pr55512-4.c -O2 -pg -fchecking
during RTL pass: reload
pr55512-4.c: In function 'bar':
pr55512-4.c:14:1: internal compiler error: maximum number of LRA assignment passes is achieved (30)
   14 | }
      | ^
0xa93650 lra_assign(bool&)
        ../../gcc/lra-assigns.cc:1694
0xa8e73c lra(_IO_FILE*)
        ../../gcc/lra.cc:2395
0xa473f9 do_reload
        ../../gcc/ira.cc:5940
0xa473f9 execute
        ../../gcc/ira.cc:6126
Comment 1 Andrew Pinski 2022-02-09 00:40:07 UTC
Confirmed.
note The ICE changed in GCC 11 from:
<source>:3:3: error: 'asm' operand has impossible constraints
    3 |   asm goto ("" : : "r" (x), "r" (x + 1), "r" (x + 2), "r" (x + 3), /* { dg-error "operand has impossible constraints" } */
      |   ^~~
<source>:3:3: error: 'asm' operand has impossible constraints
<source>:10:1: error: in basic block 2:
   10 | }
      | ^
<source>:10:1: error: in basic block 2:
 }
 ^
<source>:10:1: error: flow control insn inside a basic block
(jump_insn 23 77 75 2 (parallel [
            (asm_operands/v ("") ("") 0 []
                 []
                 [
                    (label_ref:DI 24)
                ] <source>:3)
            (clobber (reg:CCFP 18 fpsr))
            (clobber (reg:CC 17 flags))
        ]) "<source>":3 -1
     (nil)
 -> 24)

To:
<source>:10:1: internal compiler error: maximum number of LRA assignment passes is achieved (30)

So it would be useful to get the bisects at the point of change and also when it originally broke.
Comment 2 Hongtao.liu 2022-02-09 06:17:03 UTC
w/o -pg, there's an error output as expected:

../gcc.target/i386/pr55512-4.c:7:3: error: ‘asm’ operand has impossible constraints

    7 |   asm goto ("" : : "r" (x), "r" (x + 1), "r" (x + 2), "r" (x + 3), /* { dg-error "operand has impossible constraints" } */


It looks like an diagnostic issue?
Comment 3 Jakub Jelinek 2022-02-10 15:53:06 UTC
Before r8-7279-g6027ea4cd7b1e955cf7cd61e9178a89d89e3dbe2
we emitted just the 2 'asm' operand has impossible constraints errors and nothing more, since r8-7279 we ICE after those.
And starting with r11-5002-ge3b3b59683c1e7d31a9d313dd97394abebf644be
it is sometimes
internal compiler error: in lra_assign, at lra-assigns.c:1648
and sometimes
internal compiler error: maximum number of LRA assignment passes is achieved (30)
(which one changes pretty often over the revisions).
Comment 4 GCC Commits 2022-02-17 16:50:31 UTC
The master branch has been updated by Vladimir Makarov <vmakarov@gcc.gnu.org>:

https://gcc.gnu.org/g:db69f666a728ce800a840115829f6b64bc3174d2

commit r12-7278-gdb69f666a728ce800a840115829f6b64bc3174d2
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Thu Feb 17 11:31:50 2022 -0500

    [PR104447] LRA: Do not split non-alloc hard regs.
    
    LRA tried to split non-allocated hard reg for reload pseudos again and
    again until number of assignment passes reaches the limit.  The patch fixes
    this.
    
    gcc/ChangeLog:
    
            PR rtl-optimization/104447
            * lra-constraints.cc (spill_hard_reg_in_range): Initiate ignore
            hard reg set by lra_no_alloc_regs.
    
    gcc/testsuite/ChangeLog:
    
            PR rtl-optimization/104447
            * gcc.target/i386/pr104447.c: New.
Comment 5 Richard Biener 2022-05-27 09:47:25 UTC
GCC 9 branch is being closed
Comment 6 Jakub Jelinek 2022-06-28 10:48:08 UTC
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
Comment 7 Richard Biener 2023-07-07 10:42:16 UTC
GCC 10 branch is being closed.
Comment 8 Jeffrey A. Law 2024-03-11 04:35:28 UTC
Fixed back in the gcc-12 era.  Adjusting regression markers.