diff options
author | Ira Rosen <irar@il.ibm.com> | 2009-07-26 07:00:23 +0000 |
---|---|---|
committer | Ira Rosen <irar@gcc.gnu.org> | 2009-07-26 07:00:23 +0000 |
commit | 63827fb8e293cd05bf33483f5d0fcc56d3f1f10f (patch) | |
tree | 45c88e5de2ce59d579bb00397906132865c6f779 /gcc | |
parent | 23c35ef67a105e7e86ee123078f25f02d1aa656e (diff) | |
download | gcc-63827fb8e293cd05bf33483f5d0fcc56d3f1f10f.zip gcc-63827fb8e293cd05bf33483f5d0fcc56d3f1f10f.tar.gz gcc-63827fb8e293cd05bf33483f5d0fcc56d3f1f10f.tar.bz2 |
re PR tree-optimization/40801 (internal compiler error: in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1096)
PR tree-optimization/40801
* tree-vect-stmts.c (vectorizable_call): Get previous copy
of vector operand from the previous copy of vector statement.
Pass the correct definition type value to
vect_get_vec_def_for_stmt_copy().
From-SVN: r150096
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/vect/fast-math-real8-pr40801.f90 | 37 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/vect/vect.exp | 6 | ||||
-rw-r--r-- | gcc/tree-vect-stmts.c | 16 |
5 files changed, 68 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 96d4d9b..99028e8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2009-07-26 Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/40801 + * tree-vect-stmts.c (vectorizable_call): Get previous copy + of vector operand from the previous copy of vector statement. + Pass the correct definition type value to + vect_get_vec_def_for_stmt_copy(). + 2009-07-25 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> * collect2.c (scan_libraries): Use CONST_CAST2 to perform char ** to diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a0e39e3..6139e0d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2009-07-26 Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/40801 + * gfortran.dg/vect/fast-math-real8-pr40801.f90: New test. + * gfortran.dg/vect/vect.exp: Run tests starting with + "fast-math-real8" with -ffast-math and -fdefault-real-8. + 2009-07-25 David Daney <ddaney@caviumnetworks.com> PR rtl-optimization/40445 diff --git a/gcc/testsuite/gfortran.dg/vect/fast-math-real8-pr40801.f90 b/gcc/testsuite/gfortran.dg/vect/fast-math-real8-pr40801.f90 new file mode 100644 index 0000000..eb6330d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/vect/fast-math-real8-pr40801.f90 @@ -0,0 +1,37 @@ +! { dg-do compile } + +MODULE YOMPHY0 +REAL :: ECMNP +REAL :: SCO +REAL :: USDMLT +END MODULE YOMPHY0 +SUBROUTINE ACCONV ( KIDIA,KFDIA,KLON,KTDIA,KLEV,& + &CDLOCK) +USE YOMPHY0 , ONLY : ECMNP ,SCO ,USDMLT +REAL :: PAPHIF(KLON,KLEV),PCVGQ(KLON,KLEV)& + &,PFPLCL(KLON,0:KLEV),PFPLCN(KLON,0:KLEV),PSTRCU(KLON,0:KLEV)& + &,PSTRCV(KLON,0:KLEV) +INTEGER :: KNLAB(KLON,KLEV),KNND(KLON) +REAL :: ZCP(KLON,KLEV),ZLHE(KLON,KLEV),ZDSE(KLON,KLEV)& + &,ZPOII(KLON),ZALF(KLON),ZLN(KLON),ZUN(KLON),ZVN(KLON)& + &,ZPOIL(KLON) +DO JLEV=KLEV-1,KTDIA,-1 + DO JIT=1,NBITER + ZLN(JLON)=MAX(0.,ZLN(JLON)& + &-(ZQW(JLON,JLEV)-ZQN(JLON)& + &*(PQ(JLON,JLEV+1)-ZQN(JLON))))*KNLAB(JLON,JLEV) + ENDDO +ENDDO +IF (ITOP < KLEV+1) THEN + DO JLON=KIDIA,KFDIA + ZZVAL=PFPLCL(JLON,KLEV)+PFPLCN(JLON,KLEV)-SCO + KNND(JLON)=KNND(JLON)*MAX(0.,-SIGN(1.,0.-ZZVAL)) + ENDDO + DO JLEV=ITOP,KLEV + DO JLON=KIDIA,KFDIA + ENDDO + ENDDO +ENDIF +END SUBROUTINE ACCONV + +! { dg-final { cleanup-tree-dump "vect" } } diff --git a/gcc/testsuite/gfortran.dg/vect/vect.exp b/gcc/testsuite/gfortran.dg/vect/vect.exp index 00f5b00..826b64d 100644 --- a/gcc/testsuite/gfortran.dg/vect/vect.exp +++ b/gcc/testsuite/gfortran.dg/vect/vect.exp @@ -125,6 +125,12 @@ lappend DEFAULT_VECTCFLAGS "-ffast-math" dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-*.\[fF\]{,90,95,03,08} ]] \ "" $DEFAULT_VECTCFLAGS +# -ffast-math tests +set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS +lappend DEFAULT_VECTCFLAGS "-ffast-math" "-fdefault-real-8" +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-real8*.\[fF\]{,90,95,03,08} ]] \ + "" $DEFAULT_VECTCFLAGS + # -fvect-cost-model tests set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS lappend DEFAULT_VECTCFLAGS "-fvect-cost-model" diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 8e1c973..5090077 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -1227,7 +1227,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt) tree fndecl, new_temp, def, rhs_type, lhs_type; gimple def_stmt; enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type}; - gimple new_stmt; + gimple new_stmt = NULL; int ncopies, j; VEC(tree, heap) *vargs = NULL; enum { NARROW, NONE, WIDEN } modifier; @@ -1367,8 +1367,11 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt) vec_oprnd0 = vect_get_vec_def_for_operand (op, stmt, NULL); else - vec_oprnd0 - = vect_get_vec_def_for_stmt_copy (dt[nargs], vec_oprnd0); + { + vec_oprnd0 = gimple_call_arg (new_stmt, i); + vec_oprnd0 + = vect_get_vec_def_for_stmt_copy (dt[i], vec_oprnd0); + } VEC_quick_push (tree, vargs, vec_oprnd0); } @@ -1406,14 +1409,15 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt) vec_oprnd0 = vect_get_vec_def_for_operand (op, stmt, NULL); vec_oprnd1 - = vect_get_vec_def_for_stmt_copy (dt[nargs], vec_oprnd0); + = vect_get_vec_def_for_stmt_copy (dt[i], vec_oprnd0); } else { + vec_oprnd1 = gimple_call_arg (new_stmt, 2*i); vec_oprnd0 - = vect_get_vec_def_for_stmt_copy (dt[nargs], vec_oprnd1); + = vect_get_vec_def_for_stmt_copy (dt[i], vec_oprnd1); vec_oprnd1 - = vect_get_vec_def_for_stmt_copy (dt[nargs], vec_oprnd0); + = vect_get_vec_def_for_stmt_copy (dt[i], vec_oprnd0); } VEC_quick_push (tree, vargs, vec_oprnd0); |