c-common.c (c_common_type_for_mode): Match signed/unsigned types exactly.
authorMike Stump <mikestump@comcast.net>
Wed, 25 Jan 2012 00:06:27 +0000 (00:06 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Wed, 25 Jan 2012 00:06:27 +0000 (00:06 +0000)
* c-common.c (c_common_type_for_mode): Match signed/unsigned types
exactly.

From-SVN: r183503

gcc/c-family/ChangeLog
gcc/c-family/c-common.c

index c2045f940fe1be814c70e09d4dbc43f060a4c9c0..373ad298186a3b3d177bf8ee3a3e697233e6d0d9 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-24  Mike Stump  <mikestump@comcast.net>
+
+       * c-common.c (c_common_type_for_mode): Match signed/unsigned types
+       exactly.
+
 2012-01-18  Richard Guenther  <rguenther@suse.de>
 
        * c-opts.c (c_common_post_options): Reset LTO flags if
index 013c71a6420f01969aa8753973daabcdd11d2ea1..8dbf6cc2d7560840c8300731d04cc565b8ac067f 100644 (file)
@@ -3089,7 +3089,8 @@ c_common_type_for_mode (enum machine_mode mode, int unsignedp)
     }
 
   for (t = registered_builtin_types; t; t = TREE_CHAIN (t))
-    if (TYPE_MODE (TREE_VALUE (t)) == mode)
+    if (TYPE_MODE (TREE_VALUE (t)) == mode
+       && !!unsignedp == !!TYPE_UNSIGNED (TREE_VALUE (t)))
       return TREE_VALUE (t);
 
   return 0;