aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authorBill Moyer <ttk@cygnus.com>1998-05-15 17:37:51 +0000
committerJim Wilson <wilson@gcc.gnu.org>1998-05-15 10:37:51 -0700
commit829002bbab2e20744a8db95d1a5d248d8c189dcf (patch)
tree1b08f512804bdd6979b2acc9173efe1d13a6f613 /gcc/loop.c
parentb24f65cddd02f22d6ae7f3d7a89904fe3041b9ae (diff)
downloadgcc-829002bbab2e20744a8db95d1a5d248d8c189dcf.zip
gcc-829002bbab2e20744a8db95d1a5d248d8c189dcf.tar.gz
gcc-829002bbab2e20744a8db95d1a5d248d8c189dcf.tar.bz2
Patch from Bill Moyer.
* loop.c (basic_induction_var): Added test preventing CCmode parameter passed to convert_modes(). From-SVN: r19779
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index 9625feb..ce0b9b0 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -5257,7 +5257,12 @@ basic_induction_var (x, mode, dest_reg, p, inc_val, mult_val)
case CONST_INT:
case SYMBOL_REF:
case CONST:
- if (loops_enclosed == 1)
+ /* convert_modes aborts if we try to convert to or from CCmode, so just
+ exclude that case. It is very unlikely that a condition code value
+ would be a useful iterator anyways. */
+ if (loops_enclosed == 1
+ && GET_MODE_CLASS (mode) != MODE_CC
+ && GET_MODE_CLASS (GET_MODE (dest_reg)) != MODE_CC)
{
/* Possible bug here? Perhaps we don't know the mode of X. */
*inc_val = convert_modes (GET_MODE (dest_reg), mode, x, 0);