tree-cfg.c (find_taken_edge_cond_expr): Use zero_p instead of integer_zerop.
authorZdenek Dvorak <dvorakz@suse.cz>
Mon, 14 Mar 2005 15:23:43 +0000 (16:23 +0100)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Mon, 14 Mar 2005 15:23:43 +0000 (15:23 +0000)
* tree-cfg.c (find_taken_edge_cond_expr): Use zero_p instead of
integer_zerop.
* tree-gimple.c (is_gimple_min_invariant): Consider overflowed
constants invariant.

* fortran/trans-intrinsic.c (gfc_conv_intrinsic_ishft): Convert
the argument of the shift to the unsigned type.

From-SVN: r96435

gcc/ChangeLog
gcc/fortran/ChangeLog
gcc/fortran/trans-intrinsic.c
gcc/tree-cfg.c
gcc/tree-gimple.c

index abce9f293cdb81be1c6e7ff5f77b863be8186c1c..1b8f35215d726e02761096ed5bf769804d4b9760 100644 (file)
@@ -1,3 +1,10 @@
+2005-03-14  Zdenek Dvorak  <dvorakz@suse.cz>
+
+       * tree-cfg.c (find_taken_edge_cond_expr): Use zero_p instead of
+       integer_zerop.
+       * tree-gimple.c (is_gimple_min_invariant): Consider overflowed
+       constants invariant.
+
 2005-03-14  Zdenek Dvorak  <dvorakz@suse.cz>
 
        * basic-block.h (BB_VISITED): Removed.
index f116966ebdcec945ea521e5afc81aaf65a2bf88c..63172cb573b452a174bb4b89835824c19cb15608 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-14  Zdenek Dvorak  <dvorakz@suse.cz>
+
+       * fortran/trans-intrinsic.c (gfc_conv_intrinsic_ishft): Convert
+       the argument of the shift to the unsigned type.
+
 2005-03-13  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
 
        PR fortran/16907
index f5c0497f7c0a58f8c995fade3df60bbe7656fd59..f24db5fe7f9cfd1667377e41b385748bec83751a 100644 (file)
@@ -1793,7 +1793,7 @@ gfc_conv_intrinsic_ishft (gfc_se * se, gfc_expr * expr)
      numbers, and we try to be compatible with other compilers, most
      notably g77, here.  */
   rshift = fold_convert (type, build2 (RSHIFT_EXPR, utype, 
-                                      convert (type, arg), width));
+                                      convert (utype, arg), width));
 
   tmp = fold (build2 (GE_EXPR, boolean_type_node, arg2,
                      build_int_cst (TREE_TYPE (arg2), 0)));
index 18fcab7ba8e935367d6ebc9e9da2bd6a1bab0a58..32dc2bc579c952cf952ff7b232aaf3217ecb138f 100644 (file)
@@ -2376,20 +2376,11 @@ find_taken_edge_cond_expr (basic_block bb, tree val)
   edge true_edge, false_edge;
 
   extract_true_false_edges_from_block (bb, &true_edge, &false_edge);
-
-  /* Otherwise, try to determine which branch of the if() will be taken.
-     If VAL is a constant but it can't be reduced to a 0 or a 1, then
-     we don't really know which edge will be taken at runtime.  This
-     may happen when comparing addresses (e.g., if (&var1 == 4)).  */
-  if (integer_nonzerop (val))
-    return true_edge;
-  else if (integer_zerop (val))
-    return false_edge;
-
-  gcc_unreachable ();
+  
+  gcc_assert (TREE_CODE (val) == INTEGER_CST);
+  return (zero_p (val) ? false_edge : true_edge);
 }
 
-
 /* Given an INTEGER_CST VAL and the entry block BB to a SWITCH_EXPR
    statement, determine which edge will be taken out of the block.  Return
    NULL if any edge may be taken.  */
index 61d2ec74ace5cfc0d4745cd485ecee278ea08421..f69d95ef8aacfcb42e008442b24f167d44b692ae 100644 (file)
@@ -180,7 +180,7 @@ is_gimple_min_invariant (tree t)
     case STRING_CST:
     case COMPLEX_CST:
     case VECTOR_CST:
-      return !TREE_OVERFLOW (t);
+      return true;
 
     default:
       return false;