diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 1998-02-08 22:59:47 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-02-08 15:59:47 -0700 |
commit | d785152f1ef2ee51d7b6af4cdaa479156c8ae138 (patch) | |
tree | aa471035dfd833bd00e93ea835c13270ce367ae7 | |
parent | 99d73a5bdbe704b8634f0eba73114da5ae77314b (diff) | |
download | gcc-d785152f1ef2ee51d7b6af4cdaa479156c8ae138.tar.gz |
loop.c (strength_reduce): When placing increment for auto-inc case, do comparison in loop order.
* loop.c (strength_reduce): When placing increment for auto-inc
case, do comparison in loop order.
From-SVN: r17786
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/loop.c | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ebaff2d7969..332025bdbc7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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) diff --git a/gcc/loop.c b/gcc/loop.c index 4bd965d49a5..71cfebd260f 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -4068,8 +4068,14 @@ strength_reduce (scan_start, end, loop_top, insn_count, 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; |