* loop.c (strength_reduce): When placing increment for auto-inc
case, do comparison in loop order.
From-SVN: r17786
+Mon Feb 9 00:01:00 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * loop.c (strength_reduce): When placing increment for auto-inc
+ case, do comparison in loop order.
+
Fri Jan 2 23:40:09 1998 Jim Wilson (wilson@cygnus.com)
Jeffrey A Law (law@cygnus.com)
auto_inc_opt = 1;
}
/* Check for case where increment is before the the address
- giv. */
- else if (INSN_LUID (v->insn) > INSN_LUID (bl->biv->insn))
+ giv. Do this test in "loop order". */
+ else if ((INSN_LUID (v->insn) > INSN_LUID (bl->biv->insn)
+ && (INSN_LUID (v->insn) < INSN_LUID (scan_start)
+ || (INSN_LUID (bl->biv->insn)
+ > INSN_LUID (scan_start))))
+ || (INSN_LUID (v->insn) < INSN_LUID (scan_start)
+ && (INSN_LUID (scan_start)
+ < INSN_LUID (bl->biv->insn))))
auto_inc_opt = -1;
else
auto_inc_opt = 1;