aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-11-03 13:30:48 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-11-03 13:30:48 +0000
commit8b8bba2dd98b692b749bf023abf02c245ecd2515 (patch)
treed5ae6e84c8ada69121a074407f2d9138cbf36ace /gcc
parent623238466cd55becfd63ba1c739180febca29c5e (diff)
downloadgcc-8b8bba2dd98b692b749bf023abf02c245ecd2515.zip
gcc-8b8bba2dd98b692b749bf023abf02c245ecd2515.tar.gz
gcc-8b8bba2dd98b692b749bf023abf02c245ecd2515.tar.bz2
re PR tree-optimization/46190 (ICE in vect_enhance_data_refs_alignment when building fma3d)
2010-11-03 Richard Guenther <rguenther@suse.de> PR tree-optimization/46190 * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Properly compute peel iterations. * gfortran.dg/pr46190.f90: New testcase. From-SVN: r166244
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/pr46190.f9064
-rw-r--r--gcc/tree-vect-data-refs.c6
4 files changed, 79 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8f34c23..30b39a6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2010-11-03 Richard Guenther <rguenther@suse.de>
+ PR tree-optimization/46190
+ * tree-vect-data-refs.c (vect_enhance_data_refs_alignment):
+ Properly compute peel iterations.
+
+2010-11-03 Richard Guenther <rguenther@suse.de>
+
PR tree-optimization/46286
* tree-ssa-structalias.c (get_constraint_for_1): Avoid referencing
re-allocated vector data.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 12757ad..f0a8888 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2010-11-03 Richard Guenther <rguenther@suse.de>
+ PR tree-optimization/46190
+ * gfortran.dg/pr46190.f90: New testcase.
+
+2010-11-03 Richard Guenther <rguenther@suse.de>
+
PR testsuite/46274
* gcc.dg/tree-ssa/gen-vect-11a.c: Fix operator precedence.
* gcc.dg/vect/vect-19.c: Likewise.
diff --git a/gcc/testsuite/gfortran.dg/pr46190.f90 b/gcc/testsuite/gfortran.dg/pr46190.f90
new file mode 100644
index 0000000..15fad04
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr46190.f90
@@ -0,0 +1,64 @@
+! { dg-do compile }
+! { dg-options "-O2 -ftree-vectorize" }
+
+ TYPE :: spot_weld_type
+ CHARACTER(8) PLACE ! Keyword "NODE" or "POSITION"
+ END TYPE
+ TYPE (spot_weld_type), DIMENSION(:), ALLOCATABLE :: SPOT_WELD
+ INTEGER, PARAMETER :: LSRT = 12 ! Length of sorted-element-distance array
+ INTEGER &
+ & IETYP(LSRT) ! -/- Sort array for closest el's, 0/1=tri/qu
+ REAL(KIND(0D0)) &
+ & DSQRD(LSRT) ! -/- Sort array for closest el's, d**2
+ LOGICAL &
+ & COINCIDENT, &
+ & INSIDE_ELEMENT
+ IF (SPOT_WELD(NSW)%PLACE .EQ. 'POSITION') THEN
+ DO n = 1,LSRT
+ ENDDO
+ DO i = 1,NUMP3
+ DO WHILE (Distance_Squared .GT. DSQRD(n) .AND. n .LE. LSRT)
+ ENDDO
+ IF (n .LT. LSRT) THEN
+ DO k = LSRT-1,n,-1
+ DSQRD(k+1) = DSQRD(k)
+ IETYP(k+1) = IETYP(k)
+ ENDDO
+ ENDIF
+ DO n = 1,LSRT
+ IF (IETYP(n) .EQ. 0) THEN
+ INSIDE_ELEMENT = &
+ & Xi1EL(n) .GE. 0.0 .AND. Xi2EL(n) .GE. 0.0
+ IF (DSQRD(n) .LT. Dmin) THEN
+ ENDIF
+ ENDIF
+ ENDDO
+ ENDDO
+ IF (Icount .GT. 0) THEN
+ DO i = 1,Icount
+ CALL USER_MESSAGE &
+ & ( &
+ & )
+ ENDDO
+ CALL USER_MESSAGE &
+ & ( &
+ & )
+ ENDIF
+ IF &
+ & ( &
+ & .NOT.COINCIDENT &
+ & ) &
+ & THEN
+ IF (NP1 .GT. 0) THEN
+ IF (NP1 .GT. 0) THEN
+ ENDIF
+ ENDIF
+ ENDIF
+ IF (.NOT.COINCIDENT) THEN
+ DO i = 1,3
+ IF (NP(i) .GT. 0) THEN
+ ENDIF
+ ENDDO
+ ENDIF
+ ENDIF
+ END
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index b4da517..ce872cf 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -1518,7 +1518,8 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
mis = DR_MISALIGNMENT (dr) / GET_MODE_SIZE (TYPE_MODE (
TREE_TYPE (DR_REF (dr))));
npeel_tmp = (negative
- ? (mis - nelements) : (nelements - mis)) & (vf - 1);
+ ? (mis - nelements) : (nelements - mis))
+ & (nelements - 1);
/* For multiple types, it is possible that the bigger type access
will have more than one peeling option. E.g., a loop with two
@@ -1722,7 +1723,8 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
count. */
mis = DR_MISALIGNMENT (dr0);
mis /= GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (DR_REF (dr0))));
- npeel = (negative ? mis - nelements : nelements - mis) & (vf - 1);
+ npeel = ((negative ? mis - nelements : nelements - mis)
+ & (nelements - 1));
}
/* For interleaved data access every iteration accesses all the