re PR tree-optimization/65355 (vectorizer increase alignment of symbols already place...
authorJan Hubicka <hubicka@ucw.cz>
Tue, 10 Mar 2015 04:24:21 +0000 (05:24 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 10 Mar 2015 04:24:21 +0000 (04:24 +0000)
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

gcc/ChangeLog
gcc/symtab.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/section-anchors-vect-69.c
gcc/tree-vect-data-refs.c
gcc/varasm.c

index 6526a8e8d12894a10572974894280446ce5b2758..0cbeaa3b9e32c0cd35706021408fb6c47320031b 100644 (file)
@@ -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
index 38337349d15959dcef18d42a0a739a5005b0980a..88e168bd193086048b51cd38b8578364c4f8951d 100644 (file)
@@ -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;
index 2287409fb0a4f8f1a688088f79c561f3e0b677dd..ec7a3bc5ba4bc96fec68e448700ad50278469f55 100644 (file)
@@ -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
index 7b5ce734884fe253ca8b8246c0c7c9333a488af8..4916274fb0a19ccd9c086968953da7546ecb83e0 100644 (file)
@@ -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" } } */
index 5ff6307e1ac9ebb374b18a13473e5d5314d1d096..b308ac7ac680b365d58c1b0d13f6bd0786d0132b 100644 (file)
@@ -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 ())
            {
index 5fa6e4c3de479e070f886c960d5556ded8f970ff..752dccf935dfe06a9e1308731de081c5366ec4b7 100644 (file)
@@ -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)));
     }
 }