Bug 85860 - [8/9 Regression] ICE: in lra_split_hard_reg_for, at lra-assigns.c:1810: unable to find a register to spill with -flive-range-shrinkage -mbmi2
Summary: [8/9 Regression] ICE: in lra_split_hard_reg_for, at lra-assigns.c:1810: unabl...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 9.0
: P2 normal
Target Milestone: 8.4
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, ra
Depends on:
Blocks:
 
Reported: 2018-05-21 15:48 UTC by Zdenek Sojka
Modified: 2019-03-13 23:03 UTC (History)
3 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work: 7.3.1, 8.3.1, 9.0
Known to fail: 8.1.1
Last reconfirmed: 2018-06-15 00:00:00


Attachments
reduced testcase (234 bytes, text/plain)
2018-05-21 15:48 UTC, Zdenek Sojka
Details
unreduced testcase (3.38 KB, text/plain)
2018-10-26 06:04 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2018-05-21 15:48:36 UTC
Created attachment 44157 [details]
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-guess-branch-probability -flive-range-shrinkage -mbmi2 testcase.c 
testcase.c: In function 'foo':
testcase.c:20:1: error: unable to find a register to spill
 }
 ^
testcase.c:20:1: error: this is the insn:
(insn 214 65 201 3 (set (reg:DI 208)
        (reg:DI 1 dx)) "testcase.c":15 85 {*movdi_internal}
     (expr_list:REG_DEAD (reg:DI 1 dx)
        (nil)))
during RTL pass: reload
testcase.c:20:1: internal compiler error: in lra_split_hard_reg_for, at lra-assigns.c:1810
0x67a94c _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
        /repo/gcc-trunk/gcc/rtl-error.c:108
0xc47293 lra_split_hard_reg_for()
        /repo/gcc-trunk/gcc/lra-assigns.c:1810
0xc40ee9 lra(_IO_FILE*)
        /repo/gcc-trunk/gcc/lra.c:2507
0xbef719 do_reload
        /repo/gcc-trunk/gcc/ira.c:5465
0xbef719 execute
        /repo/gcc-trunk/gcc/ira.c:5649
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-260408-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ --enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra --with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld --with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-260408-checking-yes-rtl-df-extra-amd64
Thread model: posix
gcc version 9.0.0 20180520 (experimental) (GCC)
Comment 1 Jakub Jelinek 2018-06-15 14:59:58 UTC
Started with r257751.
Comment 2 Jakub Jelinek 2018-07-26 11:25:36 UTC
GCC 8.2 has been released.
Comment 3 Arseny Solokha 2018-10-26 05:07:22 UTC
I cannot reproduce it anymore w/ gcc-9.0.0-alpha20181021 snapshot (r265361). Seems to be fixed on the trunk w/ recent LRA-related patches.
Comment 4 Zdenek Sojka 2018-10-26 06:04:36 UTC
Created attachment 44904 [details]
unreduced testcase

(In reply to Arseny Solokha from comment #3)
> I cannot reproduce it anymore w/ gcc-9.0.0-alpha20181021 snapshot (r265361).
> Seems to be fixed on the trunk w/ recent LRA-related patches.

The unreduced testcase is still failing for me.

$ x86_64-pc-linux-gnu-gcc -O2 -fno-guess-branch-probability -flive-range-shrinkage -mbmi2 xxx.c -w
xxx.c: In function 'bar1':
xxx.c:62:1: error: unable to find a register to spill
   62 | }
      | ^
xxx.c:62:1: error: this is the insn:
(insn 368 117 348 3 (set (reg:DI 338)
        (reg:DI 1 dx)) "xxx.c":57:12 66 {*movdi_internal}
     (expr_list:REG_DEAD (reg:DI 1 dx)
        (nil)))
during RTL pass: reload
xxx.c:62:1: internal compiler error: in lra_split_hard_reg_for, at lra-assigns.c:1810
0x68455b _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
        /repo/gcc-trunk/gcc/rtl-error.c:108
0xc6f016 lra_split_hard_reg_for()
        /repo/gcc-trunk/gcc/lra-assigns.c:1810
0xc6870c lra(_IO_FILE*)
        /repo/gcc-trunk/gcc/lra.c:2533
0xc153e9 do_reload
        /repo/gcc-trunk/gcc/ira.c:5469
0xc153e9 execute
        /repo/gcc-trunk/gcc/ira.c:5653
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Comment 5 Jakub Jelinek 2019-02-22 15:26:18 UTC
GCC 8.3 has been released.
Comment 6 Vladimir Makarov 2019-03-13 20:35:50 UTC
Author: vmakarov
Date: Wed Mar 13 20:35:18 2019
New Revision: 269662

URL: https://gcc.gnu.org/viewcvs?rev=269662&root=gcc&view=rev
Log:
2019-03-13  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/85860
	* lra-constraints.c (inherit_in_ebb): Update
	potential_reload_hard_regs along with live_hard_regs.

2019-03-13  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/85860
	* gcc.target/i386/pr85860.c: New.


Added:
    trunk/gcc/testsuite/gcc.target/i386/pr85860.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lra-constraints.c
    trunk/gcc/testsuite/ChangeLog
Comment 7 Vladimir Makarov 2019-03-13 20:45:25 UTC
Author: vmakarov
Date: Wed Mar 13 20:44:50 2019
New Revision: 269663

URL: https://gcc.gnu.org/viewcvs?rev=269663&root=gcc&view=rev
Log:
2019-03-13  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/85860
	* lra-constraints.c (inherit_in_ebb): Update
	potential_reload_hard_regs along with live_hard_regs.

2019-03-13  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/85860
	* gcc.target/i386/pr85860.c: New.


Added:
    branches/gcc-8-branch/gcc/testsuite/gcc.target/i386/pr85860.c
Modified:
    branches/gcc-8-branch/gcc/ChangeLog
    branches/gcc-8-branch/gcc/lra-constraints.c
    branches/gcc-8-branch/gcc/testsuite/ChangeLog
Comment 8 Jakub Jelinek 2019-03-13 23:03:01 UTC
Fixed.