summaryrefslogtreecommitdiff
path: root/gcc/loop-unswitch.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-03 13:09:53 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-03 13:09:53 +0000
commit887865da0bcab5c60cd4acb466f9634845f3a7d3 (patch)
tree8e03493902a4c01b604c9731181fe877f4a8310e /gcc/loop-unswitch.c
parentb5405067c9affd81eb441935a79fb43545a646c9 (diff)
downloadgcc-887865da0bcab5c60cd4acb466f9634845f3a7d3.tar.gz
PR rtl-optimization/21330
* loop-unswitch.c (may_unswitch_on): Set *cinsn only when returning non-NULL. (unswitch_single_loop): Clear cinsn when retrying. * gcc.c-torture/execute/20050502-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99157 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop-unswitch.c')
-rw-r--r--gcc/loop-unswitch.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/loop-unswitch.c b/gcc/loop-unswitch.c
index 96d80c39477..ef4e5b8c2d4 100644
--- a/gcc/loop-unswitch.c
+++ b/gcc/loop-unswitch.c
@@ -223,11 +223,11 @@ may_unswitch_on (basic_block bb, struct loop *loop, rtx *cinsn)
if (at != BB_END (bb))
return NULL_RTX;
- *cinsn = BB_END (bb);
if (!rtx_equal_p (op[0], XEXP (test, 0))
|| !rtx_equal_p (op[1], XEXP (test, 1)))
return NULL_RTX;
+ *cinsn = BB_END (bb);
return test;
}
@@ -266,7 +266,7 @@ unswitch_single_loop (struct loops *loops, struct loop *loop,
basic_block *bbs;
struct loop *nloop;
unsigned i;
- rtx cond, rcond = NULL_RTX, conds, rconds, acond, cinsn = NULL_RTX;
+ rtx cond, rcond = NULL_RTX, conds, rconds, acond, cinsn;
int repeat;
edge e;
@@ -321,6 +321,7 @@ unswitch_single_loop (struct loops *loops, struct loop *loop,
do
{
repeat = 0;
+ cinsn = NULL_RTX;
/* Find a bb to unswitch on. */
bbs = get_loop_body (loop);