aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-01-03 10:10:13 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2020-01-03 10:10:13 +0100
commit5a6e28b5bae7a236b35994d0f64fd902a574872c (patch)
treeb510442fd9cb403da9e8760e16a7fcc4b9468f45
parent4d124378848e82e58f1349b44822cc7b1210de1e (diff)
downloadgcc-5a6e28b5bae7a236b35994d0f64fd902a574872c.zip
gcc-5a6e28b5bae7a236b35994d0f64fd902a574872c.tar.gz
gcc-5a6e28b5bae7a236b35994d0f64fd902a574872c.tar.bz2
re PR rtl-optimization/93088 (Compile time hog on gcc/testsuite/gcc.target/i386/pr56348.c w/ -O3 -funroll-loops -fno-tree-dominator-opts -fno-tree-vrp)
PR rtl-optimization/93088 * loop-iv.c (find_single_def_src): Punt after looking through 128 reg copies for regs with single definitions. Move definitions to first uses. * gcc.target/i386/pr93088.c: New test. From-SVN: r279854
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/loop-iv.c15
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/i386/pr93088.c5
4 files changed, 24 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c7883ed..ce5cb00 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2020-01-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/93088
+ * loop-iv.c (find_single_def_src): Punt after looking through
+ 128 reg copies for regs with single definitions. Move definitions
+ to first uses.
+
2020-01-02 Dennis Zhang <dennis.zhang@arm.com>
* config/arm/arm-c.c (arm_cpu_builtins): Define
diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c
index 83c3eef..6a59954 100644
--- a/gcc/loop-iv.c
+++ b/gcc/loop-iv.c
@@ -1384,24 +1384,23 @@ simple_rhs_p (rtx rhs)
static rtx
find_single_def_src (unsigned int regno)
{
- df_ref adef;
- rtx set, src;
+ rtx src = NULL_RTX;
- for (;;)
+ /* Don't look through unbounded number of single definition REG copies,
+ there might be loops for sources with uninitialized variables. */
+ for (int cnt = 0; cnt < 128; cnt++)
{
- rtx note;
- adef = DF_REG_DEF_CHAIN (regno);
+ df_ref adef = DF_REG_DEF_CHAIN (regno);
if (adef == NULL || DF_REF_NEXT_REG (adef) != NULL
|| DF_REF_IS_ARTIFICIAL (adef))
return NULL_RTX;
- set = single_set (DF_REF_INSN (adef));
+ rtx set = single_set (DF_REF_INSN (adef));
if (set == NULL || !REG_P (SET_DEST (set))
|| REGNO (SET_DEST (set)) != regno)
return NULL_RTX;
- note = find_reg_equal_equiv_note (DF_REF_INSN (adef));
-
+ rtx note = find_reg_equal_equiv_note (DF_REF_INSN (adef));
if (note && function_invariant_p (XEXP (note, 0)))
{
src = XEXP (note, 0);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2a3a45e..7be1d90 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/93088
+ * gcc.target/i386/pr93088.c: New test.
+
2020-01-03 Tobias Burnus <tobias@codesourcery.com>
PR fortran/92994
diff --git a/gcc/testsuite/gcc.target/i386/pr93088.c b/gcc/testsuite/gcc.target/i386/pr93088.c
new file mode 100644
index 0000000..dc986cf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr93088.c
@@ -0,0 +1,5 @@
+/* PR rtl-optimization/93088 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -funroll-loops -fno-tree-dominator-opts -fno-tree-vrp -w" } */
+
+#include "pr56348.c"