From: Jim Wilson Date: Wed, 28 Jul 1993 17:50:26 +0000 (-0700) Subject: (strength_reduce): Don't ignore a giv that depends on a X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e6f6eb290d40a568aa3bf4d08e8db61900af9ad5;p=gcc.git (strength_reduce): Don't ignore a giv that depends on a reversed biv. From-SVN: r5025 --- diff --git a/gcc/loop.c b/gcc/loop.c index 1d1c03abe67..d51fff7276f 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,