c-common.c (c_common_signed_or_unsigned_type): Delay the check for INTEGRAL_TYPE_P...
authorRafael Avila de Espindola <espindola@google.com>
Thu, 24 May 2007 04:38:27 +0000 (04:38 +0000)
committerRafael Espindola <espindola@gcc.gnu.org>
Thu, 24 May 2007 04:38:27 +0000 (04:38 +0000)
       * 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

gcc/ChangeLog
gcc/c-common.c
gcc/langhooks.c

index 414b1eb377196c1df282d395d25c9e97e0e06640..6422382491a27f45ece1afc61e50ddb2c7a2d4b0 100644 (file)
@@ -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>
index 3814bfde6676717f05785d3efcb269cd4420ddcf..48dcd5ddd0ee2519c1a191722610ffe9a8148f8d 100644 (file)
@@ -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)))
index ebd20b9ee723cfb174285994b0771f029e1351c0..dc816ba37c50e6d23c640266e2a1101120160ce6 100644 (file)
@@ -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);
 }