diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-08-28 00:10:42 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-08-28 00:10:42 +0000 |
commit | 9f89e8974f630e832855d8db852626b8746240af (patch) | |
tree | 1f869e9b2d08caaad6f7fa6c36b368469ed62ad6 /gcc/loop.c | |
parent | 48376bb533e28989461d666bab7ee2bd5a9a8617 (diff) | |
download | gcc-9f89e8974f630e832855d8db852626b8746240af.tar.gz |
* loop.c (check_dbra_loop): The loop ending comparison value
must be an invariant or we can not reverse the loop.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22045 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop.c')
-rw-r--r-- | gcc/loop.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/loop.c b/gcc/loop.c index 3301f7d2f29..cd257be9c35 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -6904,6 +6904,15 @@ check_dbra_loop (loop_end, insn_count, loop_start) comparison_sign_mask = (unsigned HOST_WIDE_INT)1 << (comparison_const_width - 1); + /* If the comparison value is not a loop invariant, then we + can not reverse this loop. + + ??? If the insns which initialize the comparison value as + a whole compute an invariant result, then we could move + them out of the loop and proceed with loop reversal. */ + if (!invariant_p (comparison_val)) + return 0; + if (GET_CODE (comparison_value) == CONST_INT) comparison_val = INTVAL (comparison_value); initial_value = bl->initial_value; |