tree-vect-data-refs.c (vect_compute_data_ref_alignment): Look at the DR_BASE_ADDRESS...
authorRichard Biener <rguenther@suse.de>
Wed, 9 Nov 2016 08:08:58 +0000 (08:08 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 9 Nov 2016 08:08:58 +0000 (08:08 +0000)
2016-11-09  Richard Biener  <rguenther@suse.de>

* tree-vect-data-refs.c (vect_compute_data_ref_alignment):
Look at the DR_BASE_ADDRESS object for forcing alignment.

From-SVN: r241991

gcc/ChangeLog
gcc/tree-vect-data-refs.c

index a76e3e82b54b7f912c719330cddd247fb029e892..a96c955bf07ed3626daa1212b6584d572171565c 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-09  Richard Biener  <rguenther@suse.de>
+
+       * tree-vect-data-refs.c (vect_compute_data_ref_alignment):
+       Look at the DR_BASE_ADDRESS object for forcing alignment.
+
 2016-11-09  Kugan Vivekanandarajah  <kuganv@linaro.org>
 
        * ipa-cp.c (ipa_get_jf_pass_through_result): Handle unary expressions.
index f014d688036cee3d6e0d6ef5eb32c64e7a6b70e6..220dc3026274e81ce7a8350c7bb6fde430c8d2fe 100644 (file)
@@ -813,12 +813,9 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
 
   if (base_alignment < TYPE_ALIGN (vectype))
     {
-      /* Strip an inner MEM_REF to a bare decl if possible.  */
-      if (TREE_CODE (base) == MEM_REF
-         && integer_zerop (TREE_OPERAND (base, 1))
-         && TREE_CODE (TREE_OPERAND (base, 0)) == ADDR_EXPR)
-       base = TREE_OPERAND (TREE_OPERAND (base, 0), 0);
-
+      base = base_addr;
+      if (TREE_CODE (base) == ADDR_EXPR)
+       base = TREE_OPERAND (base, 0);
       if (!vect_can_force_dr_alignment_p (base, TYPE_ALIGN (vectype)))
        {
          if (dump_enabled_p ())