aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-07-03 06:41:07 +0000
committerRichard Stallman <rms@gnu.org>1992-07-03 06:41:07 +0000
commit3fc7e39030a49b4499976a9622e15c6e97319655 (patch)
treeac992acf8c31cb17abc06f4a39d84be7041f22d5 /gcc/c-common.c
parenta5a9fc56a5c4f43a54cb15e2a16c6ea14f2dbcfe (diff)
downloadgcc-3fc7e39030a49b4499976a9622e15c6e97319655.zip
gcc-3fc7e39030a49b4499976a9622e15c6e97319655.tar.gz
gcc-3fc7e39030a49b4499976a9622e15c6e97319655.tar.bz2
(type_for_size): If no ANSI type matches, check for matches with built-in mode-related types.
(type_for_size): If no ANSI type matches, check for matches with built-in mode-related types. (type_for_mode): Likewise. From-SVN: r1397
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index cc3f0ae..3cfb680 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -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;