arc.c (arc_return_in_memory): Check the return value of int_size_in_bytes against -1.
authorKazu Hirata <kazu@cs.umass.edu>
Fri, 6 Feb 2004 05:55:07 +0000 (05:55 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Fri, 6 Feb 2004 05:55:07 +0000 (05:55 +0000)
* config/arc/arc.c (arc_return_in_memory): Check the return
value of int_size_in_bytes against -1.  Don't check
TREE_ADDRESSABLE.
* config/avr/avr.c (avr_return_in_memory): Check the return
value of int_size_in_bytes against -1.
* config/ip2k/ip2k.c (ip2k_return_in_memory): Likewise.
* config/m68hc11/m68hc11.c (m68hc11_return_in_memory):
Likewise.
* config/mcore/mcore.c (mcore_return_in_memory): Likewise.
* config/stormy16/stormy16.c (xstormy16_return_in_memory):
Likewise.

From-SVN: r77377

gcc/ChangeLog
gcc/config/arc/arc.c
gcc/config/avr/avr.c
gcc/config/ip2k/ip2k.c
gcc/config/m68hc11/m68hc11.c
gcc/config/mcore/mcore.c
gcc/config/stormy16/stormy16.c

index 6654357..32c3894 100644 (file)
@@ -1,5 +1,19 @@
 2004-02-06  Kazu Hirata  <kazu@cs.umass.edu>
 
+       * config/arc/arc.c (arc_return_in_memory): Check the return
+       value of int_size_in_bytes against -1.  Don't check
+       TREE_ADDRESSABLE.
+       * config/avr/avr.c (avr_return_in_memory): Check the return
+       value of int_size_in_bytes against -1.
+       * config/ip2k/ip2k.c (ip2k_return_in_memory): Likewise.
+       * config/m68hc11/m68hc11.c (m68hc11_return_in_memory):
+       Likewise.
+       * config/mcore/mcore.c (mcore_return_in_memory): Likewise.
+       * config/stormy16/stormy16.c (xstormy16_return_in_memory):
+       Likewise.
+
+2004-02-06  Kazu Hirata  <kazu@cs.umass.edu>
+
        * config/frv/frv-protos.h: Remove the prototype for
        frv_setup_incoming_varargs.
        * config/frv/frv.c (TARGET_SETUP_INCOMING_VARARGS): New.
index c838f32..f0c1bf2 100644 (file)
@@ -2396,7 +2396,11 @@ arc_external_libcall (rtx fun ATTRIBUTE_UNUSED)
 static bool
 arc_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
 {
-  return (AGGREGATE_TYPE_P (type)
-         || int_size_in_bytes (type) > 8
-         || TREE_ADDRESSABLE (type));
+  if (AGGREGATE_TYPE_P (type))
+    return true;
+  else
+    {
+      HOST_WIDE_INT size = int_size_in_bytes (type);
+      return (size == -1 || size > 8);
+    }
 }
index 331f7cd..07540df 100644 (file)
@@ -5384,9 +5384,13 @@ avr_asm_out_dtor (rtx symbol, int priority)
 static bool
 avr_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
 {
-  return ((TYPE_MODE (type) == BLKmode)
-         ? int_size_in_bytes (type) > 8
-         : 0);
+  if (TYPE_MODE (type) == BLKmode)
+    {
+      HOST_WIDE_INT size = int_size_in_bytes (type);
+      return (size == -1 || size > 8);
+    }
+  else
+    return false;
 }
 
 #include "gt-avr.h"
index 916fd10..13652e4 100644 (file)
@@ -6201,7 +6201,13 @@ ip2k_unsigned_comparison_operator (rtx op, enum machine_mode mode)
 static bool
 ip2k_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
 {
-  return (TYPE_MODE (type) == BLKmode) ? int_size_in_bytes (type) > 8 : 0;
+  if (TYPE_MODE (type) == BLKmode)
+    {
+      HOST_WIDE_INT size = int_size_in_bytes (type);
+      return (size == -1 || size > 8);
+    }
+  else
+    return false;
 }
 
 /* Worker function for TARGET_SETUP_INCOMING_VARARGS.  */
index c430421..e5bca2e 100644 (file)
@@ -5550,9 +5550,13 @@ m68hc11_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
 static bool
 m68hc11_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
 {
-  return ((TYPE_MODE (type) == BLKmode)
-         ? (int_size_in_bytes (type) > 4)
-         : (GET_MODE_SIZE (TYPE_MODE (type)) > 4));
+  if (TYPE_MODE (type) == BLKmode)
+    {
+      HOST_WIDE_INT size = int_size_in_bytes (type);
+      return (size == -1 || size > 4);
+    }
+  else
+    return GET_MODE_SIZE (TYPE_MODE (type)) > 4;
 }
 
 #include "gt-m68hc11.h"
index 58a4762..8f2036c 100644 (file)
@@ -3466,5 +3466,6 @@ mcore_external_libcall (rtx fun)
 static bool
 mcore_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
 {
-  return int_size_in_bytes (type) > 2 * UNITS_PER_WORD;
+  HOST_WIDE_INT size = int_size_in_bytes (type);
+  return (size == -1 || size > 2 * UNITS_PER_WORD);
 }
index 867cd21..7678ccf 100644 (file)
@@ -2170,10 +2170,13 @@ xstormy16_expand_builtin(tree exp, rtx target,
   return retval;
 }
 \f
+/* Worker function for TARGET_RETURN_IN_MEMORY.  */
+
 static bool
 xstormy16_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
 {
-  return int_size_in_bytes (type) > UNITS_PER_WORD * NUM_ARGUMENT_REGISTERS;
+  HOST_WIDE_INT size = int_size_in_bytes (type);
+  return (size == -1 || size > UNITS_PER_WORD * NUM_ARGUMENT_REGISTERS);
 }
 \f
 #undef TARGET_ASM_ALIGNED_HI_OP