]> gcc.gnu.org Git - gcc.git/commitdiff
c-common.c (shorten_compare): Don't special-case min/maxval for C enumerations.
authorRichard Henderson <rth@redhat.com>
Thu, 9 Dec 2004 22:52:15 +0000 (14:52 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 9 Dec 2004 22:52:15 +0000 (14:52 -0800)
        * c-common.c (shorten_compare): Don't special-case min/maxval
        for C enumerations.

From-SVN: r91974

gcc/ChangeLog
gcc/c-common.c

index d63fe3905cc95ab723d74711f51735190015b1cb..e8eb55880b7e0f924021ec5f39da2d2e821a419a 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-09  Richard Henderson  <rth@redhat.com>
+
+       * c-common.c (shorten_compare): Don't special-case min/maxval
+       for C enumerations.
+
 2004-12-09  Richard Sandiford  <rsandifo@redhat.com>
 
        * simplify-rtx.c (simplify_subreg): In the CONCAT case, check whether
index a6f303b814e8da5a106ba5e526d96253e6d485b5..fa555a72588920e869cf5dbe2594075f0846f317 100644 (file)
@@ -1983,14 +1983,6 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
       type = c_common_signed_or_unsigned_type (unsignedp0,
                                               TREE_TYPE (primop0));
 
-      /* In C, if TYPE is an enumeration, then we need to get its
-        min/max values from its underlying integral type, not the
-        enumerated type itself.  In C++, TYPE_MAX_VALUE and
-        TYPE_MIN_VALUE have already been set correctly on the
-        enumeration type.  */
-      if (!c_dialect_cxx () && TREE_CODE (type) == ENUMERAL_TYPE)
-       type = c_common_type_for_size (TYPE_PRECISION (type), unsignedp0);
-
       maxval = TYPE_MAX_VALUE (type);
       minval = TYPE_MIN_VALUE (type);
 
This page took 0.091925 seconds and 5 git commands to generate.