From 1e05d1854cd6d63cda5828c50735d029ce198ff2 Mon Sep 17 00:00:00 2001 From: Vladimir Makarov Date: Wed, 13 Mar 2019 20:35:18 +0000 Subject: [PATCH] re PR target/85860 (ICE: in lra_split_hard_reg_for, at lra-assigns.c:1810: unable to find a register to spill with -flive-range-shrinkage -mbmi2) 2019-03-13 Vladimir Makarov PR target/85860 * lra-constraints.c (inherit_in_ebb): Update potential_reload_hard_regs along with live_hard_regs. 2019-03-13 Vladimir Makarov PR target/85860 * gcc.target/i386/pr85860.c: New. From-SVN: r269662 --- gcc/ChangeLog | 6 ++++++ gcc/lra-constraints.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr85860.c | 23 +++++++++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/pr85860.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7c5bda1d288..baed65f898b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-03-13 Vladimir Makarov + + PR target/85860 + * lra-constraints.c (inherit_in_ebb): Update + potential_reload_hard_regs along with live_hard_regs. + 2019-03-13 Jakub Jelinek PR debug/89498 diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index afbd5d004ba..d7d69c6ba50 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -6365,6 +6365,7 @@ inherit_in_ebb (rtx_insn *head, rtx_insn *tail) add_to_hard_reg_set (&s, PSEUDO_REGNO_MODE (dst_regno), reg_renumber[dst_regno]); AND_COMPL_HARD_REG_SET (live_hard_regs, s); + AND_COMPL_HARD_REG_SET (potential_reload_hard_regs, s); } /* We should invalidate potential inheritance or splitting for the current insn usages to the next diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5f72cc2304b..f4d25f1e567 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-03-13 Vladimir Makarov + + PR target/85860 + * gcc.target/i386/pr85860.c: New. + 2019-03-13 Marek Polacek PR c++/89686 - mixing init-capture and simple-capture in lambda. diff --git a/gcc/testsuite/gcc.target/i386/pr85860.c b/gcc/testsuite/gcc.target/i386/pr85860.c new file mode 100644 index 00000000000..aef78a4b958 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr85860.c @@ -0,0 +1,23 @@ +/* { dg-do compile { target lp64 } } */ +/* { dg-options "-O2 -fno-guess-branch-probability -flive-range-shrinkage -mbmi2" } */ + +int a, b, c, d, e; + +extern int bar(void); + +__int128 +foo (unsigned g, int h, long i, __int128 j, short k, __int128 l) +{ + unsigned __int128 m = j; + do + { + j %= 5; + c = c >> (m & 31); + e = __builtin_sub_overflow (b, 0, &m); + d = bar (); + l *= __builtin_mul_overflow_p ((unsigned) d, ~(unsigned __int128) 1, + (unsigned __int128) 0); + } + while (a); + return m + j + k + l; +} -- 2.30.2