summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1999-08-15 20:08:12 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1999-08-15 20:08:12 +0000
commitd0e2e047651a84134cd8cc721ea4e28484d918de (patch)
tree628dc0d63ba7285efc78eb5dc42dd3491930fe05
parenta30833833925f270ba90b55c44d90b264f3d4bfc (diff)
downloadppe42-gcc-d0e2e047651a84134cd8cc721ea4e28484d918de.tar.gz
ppe42-gcc-d0e2e047651a84134cd8cc721ea4e28484d918de.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28717 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/explow.c4
-rw-r--r--gcc/stmt.c4
-rw-r--r--gcc/stor-layout.c2
4 files changed, 10 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 860409905e5..1f5106db9fa 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/explow.c b/gcc/explow.c
index b79aa9b63ae..2e0de41a70a 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -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);
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 8c089977239..9cfc70067a4 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -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);
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index fe9fb90da3d..408846ae989 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -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
OpenPOWER on IntegriCloud