From 887865da0bcab5c60cd4acb466f9634845f3a7d3 Mon Sep 17 00:00:00 2001 From: jakub Date: Tue, 3 May 2005 13:09:53 +0000 Subject: 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 --- gcc/loop-unswitch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/loop-unswitch.c') 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); -- cgit v1.2.1