The comment before the hunk I moved wasn't helpful, so I moved the flag_section_anchor check in error. Fixed by reverting that change and clarifying the comment.
Richard. 2012-03-16 Richard Guenther <rguent...@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 <rguent...@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. Index: gcc/tree-vect-data-refs.c =================================================================== *** gcc/tree-vect-data-refs.c (revision 185469) --- gcc/tree-vect-data-refs.c (working copy) *************** vect_compute_data_ref_alignment (struct *** 872,878 **** if (!base_aligned) { ! if (!vect_can_force_dr_alignment_p (base, TYPE_ALIGN (vectype))) { if (vect_print_dump_info (REPORT_DETAILS)) { --- 872,883 ---- if (!base_aligned) { ! /* 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)) { *************** vect_can_force_dr_alignment_p (const_tre *** 4554,4564 **** 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 --- 4559,4564 ----