aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-data-refs.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-03-09 00:12:25 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2015-03-08 23:12:25 +0000
commit428f0c67ee75be486ccdbc83bae06cebec2bdb0f (patch)
tree1677cdff3ac9a985557890e7fa6db0a63fb9c44c /gcc/tree-vect-data-refs.c
parentfb460c3da0b3de006ae596e32826ef63a65c8f2b (diff)
downloadgcc-428f0c67ee75be486ccdbc83bae06cebec2bdb0f.zip
gcc-428f0c67ee75be486ccdbc83bae06cebec2bdb0f.tar.gz
gcc-428f0c67ee75be486ccdbc83bae06cebec2bdb0f.tar.bz2
re PR ipa/65334 (r221099 caused: FAIL: gfortran.fortran-torture/execute/in-pack.f90 execution, -O2 -ftree-vectorize -msse2)
PR ipa/65334 * cgraph.h (symtab_node): Add definition_alignment, can_increase_alignment_p and increase_alignment. * symtab.c (symtab_node::can_increase_alignment_p, increase_alignment_1, symtab_node::increase_alignment, symtab_node::definition_alignment): New. * tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Use can_increase_alignment_p. * tree-vectorizer.c (increase_alignment): Use increase_alignment. * tree-vect-stmts.c (ensure_base_align): Likewise. From-SVN: r221268
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r--gcc/tree-vect-data-refs.c52
1 files changed, 2 insertions, 50 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index ffe83e2..5ff6307 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -5703,58 +5703,10 @@ vect_can_force_dr_alignment_p (const_tree decl, unsigned int alignment)
if (TREE_CODE (decl) != VAR_DECL)
return false;
- /* With -fno-toplevel-reorder we may have already output the constant. */
- if (TREE_ASM_WRITTEN (decl))
+ if (decl_in_symtab_p (decl)
+ && !symtab_node::get (decl)->can_increase_alignment_p ())
return false;
- /* Constant pool entries may be shared and not properly merged by LTO. */
- if (DECL_IN_CONSTANT_POOL (decl))
- return false;
-
- if (TREE_PUBLIC (decl) || DECL_EXTERNAL (decl))
- {
- symtab_node *snode;
-
- /* We cannot change alignment of symbols that may bind to symbols
- in other translation unit that may contain a definition with lower
- alignment. */
- if (!decl_binds_to_current_def_p (decl))
- return false;
-
- /* When compiling partition, be sure the symbol is not output by other
- partition. */
- snode = symtab_node::get (decl);
- if (flag_ltrans
- && (snode->in_other_partition
- || snode->get_partitioning_class () == SYMBOL_DUPLICATE))
- return false;
- }
-
- /* Do not override the alignment as specified by the ABI when the used
- attribute is set. */
- if (DECL_PRESERVE_P (decl))
- return false;
-
- /* Do not override explicit alignment set by the user when an explicit
- section name is also used. This is a common idiom used by many
- software projects. */
- if (TREE_STATIC (decl)
- && DECL_SECTION_NAME (decl) != NULL
- && !symtab_node::get (decl)->implicit_section)
- return false;
-
- /* If symbol is an alias, we need to check that target is OK. */
- if (TREE_STATIC (decl))
- {
- tree target = symtab_node::get (decl)->ultimate_alias_target ()->decl;
- if (target != decl)
- {
- if (DECL_PRESERVE_P (target))
- return false;
- decl = target;
- }
- }
-
if (TREE_STATIC (decl))
return (alignment <= MAX_OFILE_ALIGNMENT);
else