diff options
author | Rafael Avila de Espindola <espindola@google.com> | 2007-05-24 04:38:27 +0000 |
---|---|---|
committer | Rafael Espindola <espindola@gcc.gnu.org> | 2007-05-24 04:38:27 +0000 |
commit | 1e2041330fd0997c734a1a8d48ebaadb2037cb32 (patch) | |
tree | e16321ac90dcddb5bd7344617b086ff07f74195a /gcc | |
parent | b9061212faa98367a5a69d66074aeb0f6837d62c (diff) | |
download | gcc-1e2041330fd0997c734a1a8d48ebaadb2037cb32.zip gcc-1e2041330fd0997c734a1a8d48ebaadb2037cb32.tar.gz gcc-1e2041330fd0997c734a1a8d48ebaadb2037cb32.tar.bz2 |
c-common.c (c_common_signed_or_unsigned_type): Delay the check for INTEGRAL_TYPE_P and TYPE_UNSIGNED.
* c-common.c (c_common_signed_or_unsigned_type): Delay the check for
INTEGRAL_TYPE_P and TYPE_UNSIGNED.
* langhooks.c (get_signed_or_unsigned_type): Don't check for
INTEGRAL_TYPE_P or TYPE_UNSIGNED.
(lhd_signed_or_unsigned_type): Check for INTEGRAL_TYPE_P and
TYPE_UNSIGNED.
From-SVN: r125012
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/c-common.c | 7 | ||||
-rw-r--r-- | gcc/langhooks.c | 6 |
3 files changed, 16 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 414b1eb..6422382 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2007-05-16 Rafael Avila de Espindola <espindola@google.com> + + * c-common.c (c_common_signed_or_unsigned_type): Delay the check for + INTEGRAL_TYPE_P and TYPE_UNSIGNED. + * langhooks.c (get_signed_or_unsigned_type): Don't check for + INTEGRAL_TYPE_P or TYPE_UNSIGNED. + (lhd_signed_or_unsigned_type): Check for INTEGRAL_TYPE_P and + TYPE_UNSIGNED. + 2007-05-23 Sandra Loosemore <sandra@codesourcery.com> Nigel Stephens <nigel@mips.com> Richard Sandiford <richard@codesourcery.com> diff --git a/gcc/c-common.c b/gcc/c-common.c index 3814bfd..48dcd5d 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -2076,9 +2076,6 @@ tree c_common_signed_or_unsigned_type (int unsignedp, tree type) { tree type1; - if (!INTEGRAL_TYPE_P (type) - || TYPE_UNSIGNED (type) == unsignedp) - return type; /* This block of code emulates the behavior of the old c_common_unsigned_type. In particular, it returns @@ -2121,6 +2118,10 @@ c_common_signed_or_unsigned_type (int unsignedp, tree type) types, and producing a signed or unsigned variant of an ENUMERAL_TYPE may cause other problems as well. */ + if (!INTEGRAL_TYPE_P (type) + || TYPE_UNSIGNED (type) == unsignedp) + return type; + #define TYPE_OK(node) \ (TYPE_MODE (type) == TYPE_MODE (node) \ && (c_dialect_cxx () || TYPE_PRECISION (type) == TYPE_PRECISION (node))) diff --git a/gcc/langhooks.c b/gcc/langhooks.c index ebd20b9..dc816ba 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -579,9 +579,6 @@ lhd_builtin_function (tree decl) tree get_signed_or_unsigned_type (int unsignedp, tree type) { - if (!INTEGRAL_TYPE_P (type) || TYPE_UNSIGNED (type) == unsignedp) - return type; - return lang_hooks.types.signed_or_unsigned_type(unsignedp, type); } @@ -590,5 +587,8 @@ get_signed_or_unsigned_type (int unsignedp, tree type) tree lhd_signed_or_unsigned_type (int unsignedp, tree type) { + if (!INTEGRAL_TYPE_P (type) || TYPE_UNSIGNED (type) == unsignedp) + return type; + return lang_hooks.types.type_for_size (TYPE_PRECISION (type), unsignedp); } |