OSDN Git Service

PR tree-optimization/35982
authorirar <irar@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Apr 2008 09:21:55 +0000 (09:21 +0000)
committerirar <irar@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Apr 2008 09:21:55 +0000 (09:21 +0000)
* tree-vect-analyze.c (vect_check_interleaving): Check that the
interleaved data-refs are of the same type.

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c [new file with mode: 0644]
gcc/tree-vect-analyze.c

index 1c9599e..b567b49 100644 (file)
@@ -1,3 +1,9 @@
+2008-04-24  Ira Rosen  <irar@il.ibm.com>
+
+       PR tree-optimization/35982
+       * tree-vect-analyze.c (vect_check_interleaving): Check that the
+       interleaved data-refs are of the same type.
+
 2008-04-24  Danny Smith  <dannysmith@users.net>
 
        * c-format.c (check_format_info_main): Use strncmp rather than a magic prefix
index b533b93..187c8a9 100644 (file)
@@ -1,3 +1,8 @@
+2008-04-24  Ira Rosen  <irar@il.ibm.com>
+
+       PR tree-optimization/35982
+       * gcc.dg/vect/fast-math-pr35982.c: New.
+
 2008-04-24  Danny Smith  <dannysmith@users.net>
 
        * gcc.dg/format/ms-warnI64-1.c: New file.
diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c b/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c
new file mode 100644 (file)
index 0000000..d21c61d
--- /dev/null
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_int } */
+
+struct mem 
+{
+  float avg;
+  int len;
+};
+
+float method2_int16 (struct mem *mem)
+{
+  int i;
+  float avg;
+
+  for (i = 0; i < 100; ++i)
+     avg += mem[i].avg * (float) mem[i].len;
+
+  return avg;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_extract_even_odd  } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_extract_even_odd  } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
index 9f9ea82..26d8799 100644 (file)
@@ -1060,7 +1060,9 @@ vect_check_interleaving (struct data_reference *dra,
   type_size_b = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (drb))));
 
   if (type_size_a != type_size_b
-      || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb)))
+      || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb))
+      || !types_compatible_p (TREE_TYPE (DR_REF (dra)), 
+                              TREE_TYPE (DR_REF (drb))))
     return;
 
   init_a = TREE_INT_CST_LOW (DR_INIT (dra));