aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>2000-09-01 22:01:43 +0000
committerJim Wilson <wilson@gcc.gnu.org>2000-09-01 15:01:43 -0700
commit8a09bb272cdab13ffe5376ea9d4a9d7c47816214 (patch)
tree6327ea45abb944fe5103ee36b69180bf23f8275a /gcc
parent11a1370459e76305852e8b806fb33726449ba86e (diff)
downloadgcc-8a09bb272cdab13ffe5376ea9d4a9d7c47816214.zip
gcc-8a09bb272cdab13ffe5376ea9d4a9d7c47816214.tar.gz
gcc-8a09bb272cdab13ffe5376ea9d4a9d7c47816214.tar.bz2
Fix ia64-linux miscompilation or tcl/generic/tclCompExpr.c
Fix ia64-linux miscompilation or tcl/generic/tclCompExpr.c * loop.c (check_final_value): Check for biv use before checking for giv use. Check for both biv and giv uses. Always set last_giv_use if there is a giv use. From-SVN: r36104
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/loop.c18
2 files changed, 18 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 166df7a..8e0b387 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2000-09-01 Jim Wilson <wilson@cygnus.com>
+
+ * loop.c (check_final_value): Check for biv use before checking for
+ giv use. Check for both biv and giv uses. Always set last_giv_use
+ if there is a giv use.
+
2000-09-01 Richard Henderson <rth@cygnus.com>
* config/ia64/ia64.md (mulsi3): Use grfr_register_operand.
diff --git a/gcc/loop.c b/gcc/loop.c
index 5c70055..c5e5c4c 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -5677,19 +5677,25 @@ check_final_value (loop, v)
if (GET_CODE (p) == INSN || GET_CODE (p) == JUMP_INSN
|| GET_CODE (p) == CALL_INSN)
{
- if (biv_increment_seen)
+ /* It is possible for the BIV increment to use the GIV if we
+ have a cycle. Thus we must be sure to check each insn for
+ both BIV and GIV uses, and we must check for BIV uses
+ first. */
+
+ if (! biv_increment_seen
+ && reg_set_p (v->src_reg, PATTERN (p)))
+ biv_increment_seen = 1;
+
+ if (reg_mentioned_p (v->dest_reg, PATTERN (p)))
{
- if (reg_mentioned_p (v->dest_reg, PATTERN (p)))
+ if (biv_increment_seen)
{
v->replaceable = 0;
v->not_replaceable = 1;
break;
}
+ last_giv_use = p;
}
- else if (reg_set_p (v->src_reg, PATTERN (p)))
- biv_increment_seen = 1;
- else if (reg_mentioned_p (v->dest_reg, PATTERN (p)))
- last_giv_use = p;
}
}