OSDN Git Service

Patch from Bill Moyer.
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 May 1998 17:37:51 +0000 (17:37 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 May 1998 17:37:51 +0000 (17:37 +0000)
        * loop.c (basic_induction_var): Added test preventing
        CCmode parameter passed to convert_modes().

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19779 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/loop.c

index d4023be..05787f8 100644 (file)
@@ -1,3 +1,8 @@
+Fri May 15 17:36:11 1998  Bill Moyer <ttk@cygnus.com>
+
+        * loop.c (basic_induction_var): Added test preventing
+        CCmode parameter passed to convert_modes().
+
 Fri May 15 17:26:18 1998  Alexandre Petit-Bianco  <apbianco@cygnus.com>
 
        * expr.c (expand_expr, case EXPR_WITH_FILE_LOCATION): Save/restore
index 9625feb..ce0b9b0 100644 (file)
@@ -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);