diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1993-07-28 10:50:26 -0700 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1993-07-28 10:50:26 -0700 |
commit | e6f6eb290d40a568aa3bf4d08e8db61900af9ad5 (patch) | |
tree | 6d076eaf9a6c3098127b2df613b655bad63f4321 /gcc | |
parent | c70305f128f9ce0052d95ed082a8e7e486f42ce4 (diff) | |
download | gcc-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.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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, |