This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[LNO] PR16105


Ref : http://gcc.gnu.org/ml/gcc-patches/2004-06/msg01693.html

2004-06-22 Devang Patel <dpatel@apple.com>

PR 16105
* tree-vectorizer.c (vect_analyze_operations): Type of MODIFY_EXPR is
not reliable. Use LHS's type.


testsuite

* gcc.dg/tree-ssa-vect/pr16105.c: New test.

--
Devang

Index: tree-vectorizer.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-vectorizer.c,v
retrieving revision 1.1.2.42
diff -Idpatel.pbxuser -c -3 -p -r1.1.2.42 tree-vectorizer.c
*** tree-vectorizer.c   17 Jun 2004 18:25:13 -0000      1.1.2.42
--- tree-vectorizer.c   22 Jun 2004 06:54:43 -0000
*************** vect_analyze_operations (loop_vec_info l
*** 2437,2443 ****

if (STMT_VINFO_DATA_REF (stmt_info))
scalar_type = TREE_TYPE (DR_REF (STMT_VINFO_DATA_REF (stmt_info)));
! else
scalar_type = TREE_TYPE (stmt);
vectype = get_vectype_for_scalar_type (scalar_type);
if (!vectype)
--- 2437,2445 ----


if (STMT_VINFO_DATA_REF (stmt_info))
scalar_type = TREE_TYPE (DR_REF (STMT_VINFO_DATA_REF (stmt_info)));
! else if (TREE_CODE (stmt) == MODIFY_EXPR)
! scalar_type = TREE_TYPE (TREE_OPERAND (stmt, 0));
! else
scalar_type = TREE_TYPE (stmt);
vectype = get_vectype_for_scalar_type (scalar_type);
if (!vectype)
*************** vect_analyze_scalar_cycles (loop_vec_inf
*** 2794,2800 ****
return true;
}


-
  /* Function vect_analyze_data_ref_dependence.

Return TRUE if there (might) exist a dependence between a memory-reference
--- 2796,2801 ----
Index: testsuite/gcc.dg/tree-ssa-vect/pr16105.c
===================================================================
RCS file: testsuite/gcc.dg/tree-ssa-vect/pr16105.c
diff -N testsuite/gcc.dg/tree-ssa-vect/pr16105.c
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- testsuite/gcc.dg/tree-ssa-vect/pr16105.c 22 Jun 2004 06:54:51 -0000
***************
*** 0 ****
--- 1,22 ----
+ /* { dg-do compile { target powerpc*-*-* i?86-*-* } } */
+ /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
+ /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -msse2" { target i?86-*-* } } */
+
+ #define VECTOR_SIZE 512
+ typedef float afloat __attribute__ ((__aligned__(16)));
+
+ extern void check(const afloat * __restrict__ v);
+
+ void square(const afloat * __restrict__ a,
+ afloat * __restrict__ out)
+ {
+ unsigned int i;
+ for (i = 0; i < VECTOR_SIZE; i++) {
+ float ai = a[i];
+ float a2 = ai * ai;
+ out[i] = a2;
+ }
+ check(out);
+ }
+
+ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"} } */



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]