From: Richard Stallman Date: Fri, 3 Jul 1992 06:41:07 +0000 (+0000) Subject: (type_for_size): If no ANSI type matches, check for matches with built-in mode-relate... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3fc7e39030a49b4499976a9622e15c6e97319655;p=gcc.git (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 --- diff --git a/gcc/c-common.c b/gcc/c-common.c index cc3f0ae3651..3cfb680346e 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;