diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2015-03-10 05:24:21 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2015-03-10 04:24:21 +0000 |
commit | caf2df93de6eda7d35f78e31517a13a3676b1f5c (patch) | |
tree | 6649fcc416406122c827c2e5a9961675ab392c9a | |
parent | 57ace19f92d886930470b037f7b3cd8ef4cafae4 (diff) | |
download | gcc-caf2df93de6eda7d35f78e31517a13a3676b1f5c.zip gcc-caf2df93de6eda7d35f78e31517a13a3676b1f5c.tar.gz gcc-caf2df93de6eda7d35f78e31517a13a3676b1f5c.tar.bz2 |
re PR tree-optimization/65355 (vectorizer increase alignment of symbols already placed in anchors)
PR tree-optimization/65355
* varasm.c (notice_global_symbol): Do not produce RTL.
* symtab.c (symtab_node::can_increase_alignment_p): Check for section
anchor.
* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Do not
check for section anchors.
* gcc.dg/vect/section-anchors-vect-69.c: Update template.
From-SVN: r221297
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/symtab.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c | 2 | ||||
-rw-r--r-- | gcc/tree-vect-data-refs.c | 7 | ||||
-rw-r--r-- | gcc/varasm.c | 21 |
6 files changed, 31 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6526a8e..0cbeaa3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2015-03-10 Jan Hubicka <hubicka@ucw.cz> + + PR tree-optimization/65355 + * varasm.c (notice_global_symbol): Do not produce RTL. + * symtab.c (symtab_node::can_increase_alignment_p): Check for section + anchor. + * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Do not + check for section anchors. + 2015-03-10 Alan Modra <amodra@gmail.com> PR target/65286 diff --git a/gcc/symtab.c b/gcc/symtab.c index 3833734..88e168b 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -1924,6 +1924,13 @@ symtab_node::can_increase_alignment_p (void) if (TREE_ASM_WRITTEN (target->decl)) return false; + /* If target is already placed in an anchor, we can not touch its + alignment. */ + if (DECL_RTL_SET_P (target->decl) + && MEM_P (DECL_RTL (target->decl)) + && SYMBOL_REF_HAS_BLOCK_INFO_P (XEXP (DECL_RTL (target->decl), 0))) + return false; + /* Constant pool entries may be shared. */ if (DECL_IN_CONSTANT_POOL (target->decl)) return false; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2287409..ec7a3bc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-10 Jan Hubicka <hubicka@ucw.cz> + + PR tree-optimization/65355 + * gcc.dg/vect/section-anchors-vect-69.c: Update template. + 2015-03-09 Jakub Jelinek <jakub@redhat.com> PR c/65120 diff --git a/gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c b/gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c index 7b5ce73..4916274 100644 --- a/gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c +++ b/gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c @@ -115,6 +115,6 @@ int main (void) /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ /* Alignment forced using versioning until the pass that increases alignment is extended to handle structs. */ -/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 4 "vect" { target {vect_int && vector_alignment_reachable } } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target {vect_int && vector_alignment_reachable } } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 4 "vect" { target {vect_int && {! vector_alignment_reachable} } } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 5ff6307..b308ac7 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -758,12 +758,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr) && TREE_CODE (TREE_OPERAND (base, 0)) == ADDR_EXPR) base = TREE_OPERAND (TREE_OPERAND (base, 0), 0); - /* 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_can_force_dr_alignment_p (base, TYPE_ALIGN (vectype))) { if (dump_enabled_p ()) { diff --git a/gcc/varasm.c b/gcc/varasm.c index 5fa6e4c..752dccf 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -1630,35 +1630,30 @@ default_ctor_section_asm_out_constructor (rtx symbol, void notice_global_symbol (tree decl) { - const char **type = &first_global_object_name; + const char **t = &first_global_object_name; if (first_global_object_name || !TREE_PUBLIC (decl) || DECL_EXTERNAL (decl) || !DECL_NAME (decl) + || (TREE_CODE (decl) == VAR_DECL && DECL_HARD_REGISTER (decl)) || (TREE_CODE (decl) != FUNCTION_DECL && (TREE_CODE (decl) != VAR_DECL || (DECL_COMMON (decl) && (DECL_INITIAL (decl) == 0 - || DECL_INITIAL (decl) == error_mark_node)))) - || !MEM_P (DECL_RTL (decl))) + || DECL_INITIAL (decl) == error_mark_node))))) return; /* We win when global object is found, but it is useful to know about weak symbol as well so we can produce nicer unique names. */ if (DECL_WEAK (decl) || DECL_ONE_ONLY (decl) || flag_shlib) - type = &weak_global_object_name; + t = &weak_global_object_name; - if (!*type) + if (!*t) { - const char *p; - const char *name; - rtx decl_rtl = DECL_RTL (decl); - - p = targetm.strip_name_encoding (XSTR (XEXP (decl_rtl, 0), 0)); - name = ggc_strdup (p); - - *type = name; + tree id = DECL_ASSEMBLER_NAME (decl); + ultimate_transparent_alias_target (&id); + *t = ggc_strdup (targetm.strip_name_encoding (IDENTIFIER_POINTER (id))); } } |