]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/93088 (Compile time hog on gcc/testsuite/gcc.target/i386/pr563...
authorJakub Jelinek <jakub@redhat.com>
Wed, 22 Jan 2020 16:48:48 +0000 (17:48 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 22 Jan 2020 19:12:55 +0000 (20:12 +0100)
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.

gcc/ChangeLog
gcc/loop-iv.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr93088.c [new file with mode: 0644]

index d95b6af657319a2dcf56f87f42fa0e91e1d6bb76..3a024ce8f6e7d1db651f6b990bb625107da9bf6f 100644 (file)
@@ -1,3 +1,13 @@
+2020-01-22  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       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-22  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
index 82b4bdb15232a4eb16c257f36c18335cae628b68..340045ce8b28e4ad472fd011d6131728ccd0b36f 100644 (file)
@@ -1380,24 +1380,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);
index cd4f7f4448489514a237bcabf07ef99cb0964046..61eadf79eba8cd6b8ba4f3d87840eab3d7b3b50c 100644 (file)
@@ -1,3 +1,11 @@
+2020-01-22  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2020-01-03  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/93088
+       * gcc.target/i386/pr93088.c: New test.
+
 2020-01-22  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
diff --git a/gcc/testsuite/gcc.target/i386/pr93088.c b/gcc/testsuite/gcc.target/i386/pr93088.c
new file mode 100644 (file)
index 0000000..dc986cf
--- /dev/null
@@ -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"