diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-05-03 15:09:53 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2005-05-03 15:09:53 +0200 |
commit | 6d34654c1db34a15ee8a3cc555ad0a9b78b5d4f7 (patch) | |
tree | 8e03493902a4c01b604c9731181fe877f4a8310e /gcc/loop-unswitch.c | |
parent | 85b583d30a6f23f17bddcabfd700239ca9e10299 (diff) | |
download | gcc-6d34654c1db34a15ee8a3cc555ad0a9b78b5d4f7.zip gcc-6d34654c1db34a15ee8a3cc555ad0a9b78b5d4f7.tar.gz gcc-6d34654c1db34a15ee8a3cc555ad0a9b78b5d4f7.tar.bz2 |
re PR rtl-optimization/21330 (ICE in compare_and_jump_seq, at loop-unswitch.c:120)
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.
From-SVN: r99157
Diffstat (limited to 'gcc/loop-unswitch.c')
-rw-r--r-- | gcc/loop-unswitch.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/loop-unswitch.c b/gcc/loop-unswitch.c index 96d80c3..ef4e5b8 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); |