OSDN Git Service

2010-12-08 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Dec 2010 16:15:06 +0000 (16:15 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Dec 2010 16:15:06 +0000 (16:15 +0000)
* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Use a shift
instead of a division to divide by BITS_PER_UNIT.

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

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

index 1f23738..92b01db 100644 (file)
@@ -1,5 +1,10 @@
 2010-12-08  Richard Guenther  <rguenther@suse.de>
 
+       * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Use a shift
+       instead of a division to divide by BITS_PER_UNIT.
+
+2010-12-08  Richard Guenther  <rguenther@suse.de>
+
        * gimplify.c (gimple_tree_eq): Assert hashes are equal only
        when checking is enabled.
 
index ed1dabe..6efb245 100644 (file)
@@ -644,10 +644,11 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
                  {
                    double_int off
                      = double_int_add (tree_to_double_int (this_offset),
-                                       double_int_sdiv
+                                       double_int_rshift
                                          (tree_to_double_int (bit_offset),
-                                          uhwi_to_double_int (BITS_PER_UNIT),
-                                          TRUNC_DIV_EXPR));
+                                          BITS_PER_UNIT == 8
+                                          ? 3 : exact_log2 (BITS_PER_UNIT),
+                                          HOST_BITS_PER_DOUBLE_INT, true));
                    if (double_int_fits_in_shwi_p (off))
                      temp.off = off.low;
                  }