aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1993-07-28 10:50:26 -0700
committerJim Wilson <wilson@gcc.gnu.org>1993-07-28 10:50:26 -0700
commite6f6eb290d40a568aa3bf4d08e8db61900af9ad5 (patch)
tree6d076eaf9a6c3098127b2df613b655bad63f4321 /gcc
parentc70305f128f9ce0052d95ed082a8e7e486f42ce4 (diff)
downloadgcc-e6f6eb290d40a568aa3bf4d08e8db61900af9ad5.zip
gcc-e6f6eb290d40a568aa3bf4d08e8db61900af9ad5.tar.gz
gcc-e6f6eb290d40a568aa3bf4d08e8db61900af9ad5.tar.bz2
(strength_reduce): Don't ignore a giv that depends on a
reversed biv. From-SVN: r5025
Diffstat (limited to 'gcc')
-rw-r--r--gcc/loop.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index 1d1c03a..d51fff7 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -3708,7 +3708,14 @@ strength_reduce (scan_start, end, loop_top, insn_count,
/* If an insn is not to be strength reduced, then set its ignore
flag, and clear all_reduced. */
- if (v->lifetime * threshold * benefit < insn_count)
+ /* A giv that depends on a reversed biv must be reduced if it is
+ used after the loop exit, otherwise, it would have the wrong
+ value after the loop exit. To make it simple, just reduce all
+ of such giv's whether or not we know they are used after the loop
+ exit. */
+
+ if (v->lifetime * threshold * benefit < insn_count
+ && ! bl->reversed)
{
if (loop_dump_stream)
fprintf (loop_dump_stream,