OSDN Git Service

2005-06-15 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Jun 2005 20:13:11 +0000 (20:13 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Jun 2005 20:13:11 +0000 (20:13 +0000)
        PR tree-opt/21923
        * tree-ssa.c (tree_ssa_useless_type_conversion_1): Conversions between
        integer types whos ranges are different are not useless.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100996 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-ssa.c

index 2c98836..f0cbb56 100644 (file)
@@ -1,5 +1,11 @@
 2005-06-15  Andrew Pinski  <pinskia@physics.uc.edu>
 
+       PR tree-opt/21923
+       * tree-ssa.c (tree_ssa_useless_type_conversion_1): Conversions between
+       integer types whos ranges are different are not useless.
+
+2005-06-15  Andrew Pinski  <pinskia@physics.uc.edu>
+
        PR tree-opt/22024
        * tree-ssa-reassoc.c (init_reassoc): Also give chain decl a distint
        rank.
index 0a83b78..50c6e72 100644 (file)
@@ -902,7 +902,9 @@ tree_ssa_useless_type_conversion_1 (tree outer_type, tree inner_type)
   else if (INTEGRAL_TYPE_P (inner_type)
            && INTEGRAL_TYPE_P (outer_type)
           && TYPE_UNSIGNED (inner_type) == TYPE_UNSIGNED (outer_type)
-          && TYPE_PRECISION (inner_type) == TYPE_PRECISION (outer_type))
+          && TYPE_PRECISION (inner_type) == TYPE_PRECISION (outer_type)
+          && simple_cst_equal (TYPE_MAX_VALUE (inner_type), TYPE_MAX_VALUE (outer_type))
+          && simple_cst_equal (TYPE_MIN_VALUE (inner_type), TYPE_MIN_VALUE (outer_type)))
     {
       bool first_boolean = (TREE_CODE (inner_type) == BOOLEAN_TYPE);
       bool second_boolean = (TREE_CODE (outer_type) == BOOLEAN_TYPE);