OSDN Git Service

2009-07-21 Paul Brook <paul@codesourcery.com>
authorpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Jul 2009 12:35:38 +0000 (12:35 +0000)
committerpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Jul 2009 12:35:38 +0000 (12:35 +0000)
gcc/
* tree-vectorizer.c (increase_alignment): Handle nested arrays.
Terminate debug dump with newline.

gcc/testsuite/
* gcc.dg/vect/section-anchors-nest-1.c: New test.
* lib/target-supports.exp (check_effective_target_section_anchors):
Add arm*-*-*.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149853 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/section-anchors-nest-1.c [new file with mode: 0644]
gcc/testsuite/lib/target-supports.exp
gcc/tree-vectorizer.c

index c348015..c189dda 100644 (file)
@@ -1,3 +1,8 @@
+2009-07-21  Paul Brook <paul@codesourcery.com>
+
+       * tree-vectorizer.c (increase_alignment): Handle nested arrays.
+       Terminate debug dump with newline.
+
 2009-07-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        * pa.c (compute_zdepwi_operands): Limit deposit length to 32 - lsb.
index 5faeb99..a50af86 100644 (file)
@@ -1,3 +1,9 @@
+2009-07-21  Paul Brook <paul@codesourcery.com>
+
+       * gcc.dg/vect/section-anchors-nest-1.c: New test.
+       * lib/target-supports.exp (check_effective_target_section_anchors):
+       Add arm*-*-*.
+
 2009-07-20  Olatunji Ruwase  <tjruwase@google.com>
 
        * gcc.dg/plugin/finish_unit_plugin.c: New test.
diff --git a/gcc/testsuite/gcc.dg/vect/section-anchors-nest-1.c b/gcc/testsuite/gcc.dg/vect/section-anchors-nest-1.c
new file mode 100644 (file)
index 0000000..39a24cc
--- /dev/null
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target section_anchors } */
+/* { dg-require-effective-target vect_int } */
+/* { dg-options "-O2 -ftree-vectorize -fsection-anchors -fno-vect-cost-model -fdump-ipa-increase_alignment" } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 32
+
+static int a[N][N];
+static int b[N][N];
+static int c[N][N];
+
+void clobber(int *);
+
+int *foo(void)
+{
+  int i;
+  int j;
+
+  clobber (&a[0][0]);
+  clobber (&b[0][0]);
+  clobber (&c[0][0]);
+
+  for (i = 0; i < N; i++) {
+      for (j = 0; j < N; j++) {
+         c[j][i] += a[j][i] + c[j][i];
+      }
+  }
+  return &c[0][0];
+}
+
+/* { dg-final { scan-ipa-dump-times "Increasing alignment of decl" 3 "increase_alignment" } } */
+/* { dg -finalfoo { cleanup-ipa-dump "increase_alignment" } } */
index 306e78f..f007e04 100644 (file)
@@ -2553,7 +2553,8 @@ proc check_effective_target_section_anchors { } {
         verbose "check_effective_target_section_anchors: using cached result" 2
     } else {
         set et_section_anchors_saved 0
-        if { [istarget powerpc*-*-*] } {
+        if { [istarget powerpc*-*-*] 
+             || [istarget arm*-*-*] } {
            set et_section_anchors_saved 1
         }
     }
index 2c2103e..90abbd7 100644 (file)
@@ -337,11 +337,13 @@ increase_alignment (void)
        vnode = vnode->next_needed)
     {
       tree vectype, decl = vnode->decl;
+      tree t;
       unsigned int alignment;
 
-      if (TREE_CODE (TREE_TYPE (decl)) != ARRAY_TYPE)
+      t = TREE_TYPE(decl);
+      if (TREE_CODE (t) != ARRAY_TYPE)
         continue;
-      vectype = get_vectype_for_scalar_type (TREE_TYPE (TREE_TYPE (decl)));
+      vectype = get_vectype_for_scalar_type (strip_array_types (t));
       if (!vectype)
         continue;
       alignment = TYPE_ALIGN (vectype);
@@ -356,6 +358,7 @@ increase_alignment (void)
             {
               fprintf (dump_file, "Increasing alignment of decl: ");
               print_generic_expr (dump_file, decl, TDF_SLIM);
+             fprintf (dump_file, "\n");
             }
         }
     }