re PR target/35982 (ICE while building mplayer on ppc with -O3 -ffast-math -mcpu...
authorIra Rosen <irar@il.ibm.com>
Thu, 24 Apr 2008 09:21:55 +0000 (09:21 +0000)
committerIra Rosen <irar@gcc.gnu.org>
Thu, 24 Apr 2008 09:21:55 +0000 (09:21 +0000)
PR tree-optimization/35982
* tree-vect-analyze.c (vect_check_interleaving): Check that the
interleaved data-refs are of the same type.

From-SVN: r134624

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 1c9599e547a17cb3dc62d0d55291543813f5070f..b567b495cdc68abb6b4cb9be087f558f29fb13b2 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 b533b938dc8e0dab99eb6069c7e46119421787f4..187c8a9120241d260c21632a45a7af6638a0d2ff 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 9f9ea823f20dbba5fcc03fbdf835c67ffc91cec1..26d8799198d206df9222646364adaf6a6dd01a02 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));