2013-04-09 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Apr 2013 10:48:59 +0000 (10:48 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 9 Apr 2013 10:48:59 +0000 (10:48 +0000)
java/
* expr.c (build_java_binop): Pass a type to build_int_cst.

* tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa): Avoid
work that is not necessary.

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

gcc/ChangeLog
gcc/java/ChangeLog
gcc/java/expr.c
gcc/tree-ssa-loop-manip.c

index 4076769..248ee1e 100644 (file)
@@ -1,3 +1,8 @@
+2013-04-09  Richard Biener  <rguenther@suse.de>
+
+       * tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa): Avoid
+       work that is not necessary.
+
 2013-04-09  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/56854
index 29db4eb..f99a993 100644 (file)
@@ -1,3 +1,7 @@
+2013-04-09  Richard Biener  <rguenther@suse.de>
+
+       * expr.c (build_java_binop): Pass a type to build_int_cst.
+
 2013-03-22  Kai Tietz  <ktietz@redhat.com>
 
        * lang.c (put_decl_node): Don't iterate over end_params_node.
index b71d8a0..a434913 100644 (file)
@@ -1531,7 +1531,7 @@ build_java_binop (enum tree_code op, tree type, tree arg1, tree arg2)
       }
     case LSHIFT_EXPR:
     case RSHIFT_EXPR:
-      mask = build_int_cst (NULL_TREE,
+      mask = build_int_cst (int_type_node,
                            TYPE_PRECISION (TREE_TYPE (arg1)) - 1);
       arg2 = fold_build2 (BIT_AND_EXPR, int_type_node, arg2, mask);
       break;
index a0516c4..7101f30 100644 (file)
@@ -489,7 +489,6 @@ find_uses_to_rename (bitmap changed_bbs, bitmap *use_blocks, bitmap need_phis)
 void
 rewrite_into_loop_closed_ssa (bitmap changed_bbs, unsigned update_flag)
 {
-  bitmap *loop_exits;
   bitmap *use_blocks;
   bitmap names_to_rename;
 
@@ -505,11 +504,6 @@ rewrite_into_loop_closed_ssa (bitmap changed_bbs, unsigned update_flag)
 
   names_to_rename = BITMAP_ALLOC (&loop_renamer_obstack);
 
-  /* An array of bitmaps where LOOP_EXITS[I] is the set of basic blocks
-     that are the destination of an edge exiting loop number I.  */
-  loop_exits = XNEWVEC (bitmap, number_of_loops ());
-  get_loops_exits (loop_exits);
-
   /* Uses of names to rename.  We don't have to initialize this array,
      because we know that we will only have entries for the SSA names
      in NAMES_TO_RENAME.  */
@@ -518,17 +512,26 @@ rewrite_into_loop_closed_ssa (bitmap changed_bbs, unsigned update_flag)
   /* Find the uses outside loops.  */
   find_uses_to_rename (changed_bbs, use_blocks, names_to_rename);
 
-  /* Add the PHI nodes on exits of the loops for the names we need to
-     rewrite.  */
-  add_exit_phis (names_to_rename, use_blocks, loop_exits);
+  if (!bitmap_empty_p (names_to_rename))
+    {
+      /* An array of bitmaps where LOOP_EXITS[I] is the set of basic blocks
+        that are the destination of an edge exiting loop number I.  */
+      bitmap *loop_exits = XNEWVEC (bitmap, number_of_loops ());
+      get_loops_exits (loop_exits);
+
+      /* Add the PHI nodes on exits of the loops for the names we need to
+        rewrite.  */
+      add_exit_phis (names_to_rename, use_blocks, loop_exits);
+
+      free (loop_exits);
+
+      /* Fix up all the names found to be used outside their original
+        loops.  */
+      update_ssa (TODO_update_ssa);
+    }
 
   bitmap_obstack_release (&loop_renamer_obstack);
   free (use_blocks);
-  free (loop_exits);
-
-  /* Fix up all the names found to be used outside their original
-     loops.  */
-  update_ssa (TODO_update_ssa);
 }
 
 /* Check invariants of the loop closed ssa form for the USE in BB.  */