From 02c19aa78c6303686849de7db4378c8e6a706bc2 Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Fri, 12 Dec 2003 18:37:07 +0000 Subject: [PATCH] re PR rtl-optimization/13037 ([gcse-lm] g77 generates incorrect code) 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 | 6 ++++++ gcc/loop.c | 4 ++++ gcc/testsuite/ChangeLog | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b9a37ff7c66c..9c0fc93d0cca 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-12-12 Roger Sayle + + 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 * config/ia64/linux.h (IA64_GATE_AREA_END): Increase by 64K. diff --git a/gcc/loop.c b/gcc/loop.c index 1c5409873bfe..41866ca8a154 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8f8ab9a0b5a6..a56544d2f6a9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-12-12 Roger Sayle + + PR optimization/13037 + * g77.f-torture/execute/13037.f: New test case. + 2003-12-12 Jakub Jelinek * g++.dg/eh/ia64-1.C: New test. -- 2.47.2