From 003cd04c4b2a601f232331a48d9fc3c908905a21 Mon Sep 17 00:00:00 2001 From: Vladimir Makarov Date: Tue, 18 Dec 2018 21:20:16 +0000 Subject: [PATCH] re PR rtl-optimization/87759 (ICE in lra_assign, at lra-assigns.c:1624, or ICE: Maximum number of LRA assignment passes is achieved (30), or compile-time hog) 2018-12-18 Vladimir Makarov PR rtl-optimization/87759 * lra-assigns.c (lra_split_hard_reg_for): Recalculate non_reload_pseudos. 2018-12-18 Vladimir Makarov PR rtl-optimization/87759 * gcc.target/i386/pr87759.c: New. From-SVN: r267244 --- gcc/ChangeLog | 6 ++++ gcc/lra-assigns.c | 5 ++++ gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/gcc.target/i386/pr87759.c | 39 +++++++++++++++++++++++++ 4 files changed, 55 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/pr87759.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a4051f7acd2..e9f5baa6557 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-12-18 Vladimir Makarov + + PR rtl-optimization/87759 + * lra-assigns.c (lra_split_hard_reg_for): Recalculate + non_reload_pseudos. + 2018-12-18 Jakub Jelinek PR target/88464 diff --git a/gcc/lra-assigns.c b/gcc/lra-assigns.c index 6b9d3ae4deb..c43fedad74c 100644 --- a/gcc/lra-assigns.c +++ b/gcc/lra-assigns.c @@ -1758,6 +1758,10 @@ lra_split_hard_reg_for (void) "\n****** Splitting a hard reg after assignment #%d: ******\n\n", lra_assignment_iter); bitmap_initialize (&failed_reload_pseudos, ®_obstack); + bitmap_initialize (&non_reload_pseudos, ®_obstack); + bitmap_ior (&non_reload_pseudos, &lra_inheritance_pseudos, &lra_split_regs); + bitmap_ior_into (&non_reload_pseudos, &lra_subreg_reload_pseudos); + bitmap_ior_into (&non_reload_pseudos, &lra_optional_reload_pseudos); for (i = lra_constraint_new_regno_start; i < max_regno; i++) if (reg_renumber[i] < 0 && lra_reg_info[i].nrefs != 0 && (rclass = lra_get_allocno_class (i)) != NO_REGS @@ -1772,6 +1776,7 @@ lra_split_hard_reg_for (void) } bitmap_set_bit (&failed_reload_pseudos, i); } + bitmap_clear (&non_reload_pseudos); bitmap_initialize (&failed_reload_insns, ®_obstack); EXECUTE_IF_SET_IN_BITMAP (&failed_reload_pseudos, 0, u, bi) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e8a58688927..d1eab574617 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-12-18 Vladimir Makarov + + PR rtl-optimization/87759 + * gcc.target/i386/pr87759.c: New. + 2018-12-18 Jakub Jelinek PR target/88464 diff --git a/gcc/testsuite/gcc.target/i386/pr87759.c b/gcc/testsuite/gcc.target/i386/pr87759.c new file mode 100644 index 00000000000..253d8270963 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr87759.c @@ -0,0 +1,39 @@ +/* PR rtl-optimization/87759 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -w -fschedule-insns -fselective-scheduling -ftrapv -fno-dce -fno-expensive-optimizations -fno-ipa-ra -fno-tree-dce -fno-tree-ter" } */ + +int cc; + +void +rc (__int128 *oi) +{ + __int128 qz = (__int128)2 << cc; + + if (qz != 0) + { + if (cc != 0) + { + __int128 zp = 1; + + for (;;) + { + unsigned __int128 *ar = &cc; + int y5; + + if (oi != 0) + { + y3: + zp = *oi + *ar; + } + + y5 = (cc + 1) == ((*ar /= *oi) << ((zp >>= 128) / cc)); + qz += !!y5 ? 1 : qz == (*ar ^ zp + 1); + ++*oi; + } + } + else + ++qz; + } + + goto y3; +} -- 2.30.2