]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR tree-optimization/69270
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 Jan 2016 02:45:44 +0000 (02:45 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 Jan 2016 02:45:44 +0000 (02:45 +0000)
        * tree-ssa-dom.c (ssa_name_has_boolean_range): If the type has a
        single bit of precision, verify it's also unsigned.
        (record_edge_info): Use constant_boolean_node rather than fold_convert
        to convert boolean_true/boolean_false to the right type.

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

gcc/ChangeLog
gcc/tree-ssa-dom.c

index 790662511d1ba60de97545e6b4f9f0586f7c3adb..6f9c6a5f90673f84bfbae315b91d11e670ac0c2b 100644 (file)
@@ -1,3 +1,11 @@
+2016-01-14  Jeff Law  <law@redhat.com>
+
+       PR tree-optimization/69270
+       * tree-ssa-dom.c (ssa_name_has_boolean_range): If the type has a
+       single bit of precision, verify it's also unsigned.
+       (record_edge_info): Use constant_boolean_node rather than fold_convert
+       to convert boolean_true/boolean_false to the right type.
+
 2016-01-14  Richard Henderson  <rth@redhat.com>
 
        PR rtl-opt/69014
index da4faca9cf85d9dc5cdc2a937fb7e8cb9e35220f..f2257b33dd36505e194c2bbc92c8f838dfc535d9 100644 (file)
@@ -319,8 +319,8 @@ record_conditions (struct edge_info *edge_info, tree cond, tree inverted)
 /* Return TRUE is OP, an SSA_NAME has a range of values [0..1], false
    otherwise.
 
-   This can be because it is a boolean type, any type with
-   a single bit of precision, or has known range of [0..1]
+   This can be because it is a boolean type, any unsigned integral
+   type with a single bit of precision, or has known range of [0..1]
    via VRP analysis.  */
 
 static bool
@@ -332,6 +332,7 @@ ssa_name_has_boolean_range (tree op)
 
   /* An integral type with a single bit of precision.  */
   if (INTEGRAL_TYPE_P (TREE_TYPE (op))
+      && TYPE_UNSIGNED (TREE_TYPE (op))
       && TYPE_PRECISION (TREE_TYPE (op)) == 1)
     return true;
 
@@ -425,10 +426,9 @@ record_edge_info (basic_block bb)
              && ssa_name_has_boolean_range (op0)
               && is_gimple_min_invariant (op1))
             {
-             tree true_val = fold_convert (TREE_TYPE (op0),
-                                           boolean_true_node);
-             tree false_val = fold_convert (TREE_TYPE (op0),
-                                            boolean_false_node);
+             tree true_val = constant_boolean_node (true, TREE_TYPE (op0));
+             tree false_val = constant_boolean_node (false, TREE_TYPE (op0));
+
               if (code == EQ_EXPR)
                 {
                   edge_info = allocate_edge_info (true_edge);