]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/13037 ([gcse-lm] g77 generates incorrect code)
authorRoger Sayle <roger@eyesopen.com>
Fri, 12 Dec 2003 18:37:07 +0000 (18:37 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Fri, 12 Dec 2003 18:37:07 +0000 (18:37 +0000)
PR optimization/13037
* loop.c (update_giv_derive): Ignore redundant sets of a biv when
calculating how to derive a giv from a biv.

* g77.f-torture/execute/13037.f: New test case.

From-SVN: r74579

gcc/ChangeLog
gcc/loop.c
gcc/testsuite/ChangeLog

index b9a37ff7c66cf0b935b567bef04606e990e02438..9c0fc93d0ccaef3434bd525e1924e67cfc6fb39a 100644 (file)
@@ -1,3 +1,9 @@
+2003-12-12  Roger Sayle  <roger@eyesopen.com>
+
+       PR optimization/13037
+       * loop.c (update_giv_derive): Ignore redundant sets of a biv when
+       calculating how to derive a giv from a biv.
+
 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
 
        * config/ia64/linux.h (IA64_GATE_AREA_END): Increase by 64K.
index 1c5409873bfe8c5549a48412833945e1fdd246eb..41866ca8a1544bc50486400ea244a40f6f7de766 100644 (file)
@@ -6172,6 +6172,10 @@ update_giv_derive (loop, p)
       if (GET_CODE (p) == CODE_LABEL || GET_CODE (p) == JUMP_INSN
          || biv->insn == p)
        {
+         /* Skip if location is the same as a previous one.  */
+         if (biv->same)
+           continue;
+
          for (giv = bl->giv; giv; giv = giv->next_iv)
            {
              /* If cant_derive is already true, there is no point in
index 8f8ab9a0b5a6a7009f68e97508bf7baf29c50ee8..a56544d2f6a9f2ddfc6f7b7c1d691047150ab1b4 100644 (file)
@@ -1,3 +1,8 @@
+2003-12-12  Roger Sayle  <roger@eyesopen.com>
+
+       PR optimization/13037
+       * g77.f-torture/execute/13037.f: New test case.
+
 2003-12-12  Jakub Jelinek  <jakub@redhat.com>
 
        * g++.dg/eh/ia64-1.C: New test.