Commit 0c61f541 by Jim Wilson Committed by Jim Wilson

Fix misuses of MAX_MACHINE_MODE that can result in an infinite loop.

	* 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
parent d3ca5cdd
Sun Aug 15 12:41:21 1999 Jim Wilson <wilson@cygnus.com> 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 * genemit.c (gen_expand): If next is MATCH_PAR_DUP, then output
emit call instead of emit_insn call. emit call instead of emit_insn call.
......
...@@ -1529,7 +1529,7 @@ hard_function_value (valtype, func) ...@@ -1529,7 +1529,7 @@ hard_function_value (valtype, func)
int bytes = int_size_in_bytes (valtype); int bytes = int_size_in_bytes (valtype);
enum machine_mode tmpmode; enum machine_mode tmpmode;
for (tmpmode = GET_CLASS_NARROWEST_MODE (MODE_INT); for (tmpmode = GET_CLASS_NARROWEST_MODE (MODE_INT);
tmpmode != MAX_MACHINE_MODE; tmpmode != VOIDmode;
tmpmode = GET_MODE_WIDER_MODE (tmpmode)) tmpmode = GET_MODE_WIDER_MODE (tmpmode))
{ {
/* Have we found a large enough mode? */ /* Have we found a large enough mode? */
...@@ -1538,7 +1538,7 @@ hard_function_value (valtype, func) ...@@ -1538,7 +1538,7 @@ hard_function_value (valtype, func)
} }
/* No suitable mode found. */ /* No suitable mode found. */
if (tmpmode == MAX_MACHINE_MODE) if (tmpmode == VOIDmode)
abort (); abort ();
PUT_MODE (val, tmpmode); PUT_MODE (val, tmpmode);
......
...@@ -2817,7 +2817,7 @@ expand_return (retval) ...@@ -2817,7 +2817,7 @@ expand_return (retval)
on the USE insn for the return register. */ on the USE insn for the return register. */
bytes = int_size_in_bytes (TREE_TYPE (retval_rhs)); bytes = int_size_in_bytes (TREE_TYPE (retval_rhs));
for (tmpmode = GET_CLASS_NARROWEST_MODE (MODE_INT); for (tmpmode = GET_CLASS_NARROWEST_MODE (MODE_INT);
tmpmode != MAX_MACHINE_MODE; tmpmode != VOIDmode;
tmpmode = GET_MODE_WIDER_MODE (tmpmode)) tmpmode = GET_MODE_WIDER_MODE (tmpmode))
{ {
/* Have we found a large enough mode? */ /* Have we found a large enough mode? */
...@@ -2826,7 +2826,7 @@ expand_return (retval) ...@@ -2826,7 +2826,7 @@ expand_return (retval)
} }
/* No suitable mode found. */ /* No suitable mode found. */
if (tmpmode == MAX_MACHINE_MODE) if (tmpmode == VOIDmode)
abort (); abort ();
PUT_MODE (DECL_RTL (DECL_RESULT (current_function_decl)), tmpmode); PUT_MODE (DECL_RTL (DECL_RESULT (current_function_decl)), tmpmode);
......
...@@ -1352,7 +1352,7 @@ get_best_mode (bitsize, bitpos, align, largest_mode, volatilep) ...@@ -1352,7 +1352,7 @@ get_best_mode (bitsize, bitpos, align, largest_mode, volatilep)
break; break;
} }
if (mode == MAX_MACHINE_MODE if (mode == VOIDmode
/* It is tempting to omit the following line /* It is tempting to omit the following line
if STRICT_ALIGNMENT is true. if STRICT_ALIGNMENT is true.
But that is incorrect, since if the bitfield uses part of 3 bytes But that is incorrect, since if the bitfield uses part of 3 bytes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment