re PR middle-end/52603 (Test failures in gcc.dg/vect: vectorizing unaligned access)
authorRichard Guenther <rguenther@suse.de>
Fri, 16 Mar 2012 16:48:31 +0000 (16:48 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 16 Mar 2012 16:48:31 +0000 (16:48 +0000)
2012-03-16  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/52603
* tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Clarify
comment.

Revert
2012-03-14  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/52571
* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Move
flag_section_anchors check ...
(vect_can_force_dr_alignment_p): ... here.

From-SVN: r185474

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

index d5178812921bfe06b5d0a698e0768c3d5619778b..9399c2de63ddbc4639ec7b10eaf0051789805c76 100644 (file)
@@ -1,3 +1,17 @@
+2012-03-16  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/52603
+       * tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Clarify
+       comment.
+
+       Revert
+       2012-03-14  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/52571
+       * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Move
+       flag_section_anchors check ...
+       (vect_can_force_dr_alignment_p): ... here.
+
 2012-03-16  Martin Jambor  <mjambor@suse.cz>
 
        * expr.c (expand_expr_real_1): handle misaligned scalar reads from
index 9b66d86d1247224018583ee2bab13dccdb892414..d6bfe6c60733f044b98ebe7edd1b6ee40d69f973 100644 (file)
@@ -872,7 +872,12 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
 
   if (!base_aligned)
     {
-      if (!vect_can_force_dr_alignment_p (base, TYPE_ALIGN (vectype)))
+      /* Do not change the alignment of global variables here if
+        flag_section_anchors is enabled as we already generated
+        RTL for other functions.  Most global variables should
+        have been aligned during the IPA increase_alignment pass.  */
+      if (!vect_can_force_dr_alignment_p (base, TYPE_ALIGN (vectype))
+         || (TREE_STATIC (base) && flag_section_anchors))
        {
          if (vect_print_dump_info (REPORT_DETAILS))
            {
@@ -4554,11 +4559,6 @@ vect_can_force_dr_alignment_p (const_tree decl, unsigned int alignment)
   if (TREE_ASM_WRITTEN (decl))
     return false;
 
-  /* Do not change the alignment of global variables if flag_section_anchors
-     is enabled.  */
-  if (TREE_STATIC (decl) && flag_section_anchors)
-    return false;
-
   if (TREE_STATIC (decl))
     return (alignment <= MAX_OFILE_ALIGNMENT);
   else