Fix misuses of MAX_MACHINE_MODE that can result in an infinite loop.
authorJim Wilson <wilson@cygnus.com>
Sun, 15 Aug 1999 20:08:12 +0000 (20:08 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Sun, 15 Aug 1999 20:08:12 +0000 (13:08 -0700)
* explow.c (hard_function_value): Use VOIDmode instead of
MAX_MACHINE_MODE.
* stmt.c (expand_return): Likewise.
* stor-layout.c (get_best_mode): Likewise.

From-SVN: r28717

gcc/ChangeLog
gcc/explow.c
gcc/stmt.c
gcc/stor-layout.c

index 860409905e5e51c63601405d124e61d98d566865..1f5106db9fa81fe123cad1d56ea45e24fb30dca5 100644 (file)
@@ -1,5 +1,10 @@
 Sun Aug 15 12:41:21 1999  Jim Wilson  <wilson@cygnus.com>
 
+       * explow.c (hard_function_value): Use VOIDmode instead of
+       MAX_MACHINE_MODE.
+       * stmt.c (expand_return): Likewise.
+       * stor-layout.c (get_best_mode): Likewise.
+       
        * genemit.c (gen_expand): If next is MATCH_PAR_DUP, then output
        emit call instead of emit_insn call.
 
index b79aa9b63aed2d8e9627dc635a9467bc6cc1064c..2e0de41a70af2f16df27e8988692be12e63f2722 100644 (file)
@@ -1529,7 +1529,7 @@ hard_function_value (valtype, func)
       int bytes = int_size_in_bytes (valtype);
       enum machine_mode tmpmode;
       for (tmpmode = GET_CLASS_NARROWEST_MODE (MODE_INT);
-           tmpmode != MAX_MACHINE_MODE;
+           tmpmode != VOIDmode;
            tmpmode = GET_MODE_WIDER_MODE (tmpmode))
         {
           /* Have we found a large enough mode?  */
@@ -1538,7 +1538,7 @@ hard_function_value (valtype, func)
         }
 
       /* No suitable mode found.  */
-      if (tmpmode == MAX_MACHINE_MODE)
+      if (tmpmode == VOIDmode)
         abort ();
 
       PUT_MODE (val, tmpmode);
index 8c089977239243a037be672e29efb0043e4d770d..9cfc70067a4cc45c4022cdc83ec159527e5356d9 100644 (file)
@@ -2817,7 +2817,7 @@ expand_return (retval)
         on the USE insn for the return register.   */
       bytes = int_size_in_bytes (TREE_TYPE (retval_rhs));
       for (tmpmode = GET_CLASS_NARROWEST_MODE (MODE_INT);
-          tmpmode != MAX_MACHINE_MODE;
+          tmpmode != VOIDmode;
           tmpmode = GET_MODE_WIDER_MODE (tmpmode))
        {
          /* Have we found a large enough mode?  */
@@ -2826,7 +2826,7 @@ expand_return (retval)
        }
 
       /* No suitable mode found.  */
-      if (tmpmode == MAX_MACHINE_MODE)
+      if (tmpmode == VOIDmode)
        abort ();
 
       PUT_MODE (DECL_RTL (DECL_RESULT (current_function_decl)), tmpmode);
index fe9fb90da3dbcf1afa4ed041533a3cffafb6e333..408846ae9896c2a1c4f9d328b53148f69a0d9e46 100644 (file)
@@ -1352,7 +1352,7 @@ get_best_mode (bitsize, bitpos, align, largest_mode, volatilep)
        break;
     }
 
-  if (mode == MAX_MACHINE_MODE
+  if (mode == VOIDmode
       /* It is tempting to omit the following line
         if STRICT_ALIGNMENT is true.
         But that is incorrect, since if the bitfield uses part of 3 bytes