From 0e37a1c243896f03ad5fbfd4d3306802e20bc564 Mon Sep 17 00:00:00 2001 From: Ira Rosen Date: Thu, 24 Apr 2008 09:21:55 +0000 Subject: [PATCH] re PR target/35982 (ICE while building mplayer on ppc with -O3 -ffast-math -mcpu=970) 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 | 6 +++++ gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c | 25 +++++++++++++++++++ gcc/tree-vect-analyze.c | 4 ++- 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1c9599e547a..b567b495cdc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-04-24 Ira Rosen + + 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 * c-format.c (check_format_info_main): Use strncmp rather than a magic prefix diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b533b938dc8..187c8a91202 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-04-24 Ira Rosen + + PR tree-optimization/35982 + * gcc.dg/vect/fast-math-pr35982.c: New. + 2008-04-24 Danny Smith * 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 index 00000000000..d21c61dd934 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c @@ -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" } } */ + diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c index 9f9ea823f20..26d8799198d 100644 --- a/gcc/tree-vect-analyze.c +++ b/gcc/tree-vect-analyze.c @@ -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)); -- 2.30.2