(type_for_size): If no ANSI type matches, check for matches with built-in mode-relate...
authorRichard Stallman <rms@gnu.org>
Fri, 3 Jul 1992 06:41:07 +0000 (06:41 +0000)
committerRichard Stallman <rms@gnu.org>
Fri, 3 Jul 1992 06:41:07 +0000 (06:41 +0000)
(type_for_size):  If no ANSI type matches, check for
matches with built-in mode-related types.
(type_for_mode):  Likewise.

From-SVN: r1397

gcc/c-common.c

index cc3f0ae3651340525faffca4aa07d7aff7b89682..3cfb680346e2f17bcb28bf89d7c923b4533de646 100644 (file)
@@ -339,22 +339,34 @@ type_for_size (bits, unsignedp)
      unsigned bits;
      int unsignedp;
 {
-  if (bits <= TYPE_PRECISION (signed_char_type_node))
+  if (bits == TYPE_PRECISION (signed_char_type_node))
     return unsignedp ? unsigned_char_type_node : signed_char_type_node;
 
-  if (bits <= TYPE_PRECISION (short_integer_type_node))
+  if (bits == TYPE_PRECISION (short_integer_type_node))
     return unsignedp ? short_unsigned_type_node : short_integer_type_node;
 
-  if (bits <= TYPE_PRECISION (integer_type_node))
+  if (bits == TYPE_PRECISION (integer_type_node))
     return unsignedp ? unsigned_type_node : integer_type_node;
 
-  if (bits <= TYPE_PRECISION (long_integer_type_node))
+  if (bits == TYPE_PRECISION (long_integer_type_node))
     return unsignedp ? long_unsigned_type_node : long_integer_type_node;
 
-  if (bits <= TYPE_PRECISION (long_long_integer_type_node))
+  if (bits == TYPE_PRECISION (long_long_integer_type_node))
     return (unsignedp ? long_long_unsigned_type_node
            : long_long_integer_type_node);
 
+  if (bits <= TYPE_PRECISION (intQI_type_node))
+    return unsignedp ? unsigned_intQI_type_node : intQI_type_node;
+
+  if (bits <= TYPE_PRECISION (intHI_type_node))
+    return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
+
+  if (bits <= TYPE_PRECISION (intSI_type_node))
+    return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
+
+  if (bits <= TYPE_PRECISION (intDI_type_node))
+    return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
+
   return 0;
 }
 
@@ -382,6 +394,18 @@ type_for_mode (mode, unsignedp)
   if (mode == TYPE_MODE (long_long_integer_type_node))
     return unsignedp ? long_long_unsigned_type_node : long_long_integer_type_node;
 
+  if (mode == TYPE_MODE (intQI_type_node))
+    return unsignedp ? unsigned_intQI_type_node : intQI_type_node;
+
+  if (mode == TYPE_MODE (intHI_type_node))
+    return unsignedp ? unsigned_intHI_type_node : intHI_type_node;
+
+  if (mode == TYPE_MODE (intSI_type_node))
+    return unsignedp ? unsigned_intSI_type_node : intSI_type_node;
+
+  if (mode == TYPE_MODE (intDI_type_node))
+    return unsignedp ? unsigned_intDI_type_node : intDI_type_node;
+
   if (mode == TYPE_MODE (float_type_node))
     return float_type_node;