re PR tree-optimization/48329 (Missed vectorization of reduction due to PRE)

2014-04-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/48329
	* gfortran.dg/vect/pr48329.f90: New testcase.

From-SVN: r209930
This commit is contained in:
Richard Biener 2014-04-30 11:43:41 +00:00 committed by Richard Biener
parent e9ff9caf26
commit a32776927e
2 changed files with 34 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2014-04-30 Richard Biener <rguenther@suse.de>
PR tree-optimization/48329
* gfortran.dg/vect/pr48329.f90: New testcase.
2014-04-30 Marek Polacek <polacek@redhat.com>
* c-c++-common/ubsan/div-by-zero-5.c: Fix formatting.

View File

@ -0,0 +1,29 @@
! { dg-do compile }
! { dg-require-effective-target vect_float }
! { dg-require-effective-target vect_intfloat_cvt }
! { dg-additional-options "-ffast-math" }
program calcpi
implicit none
real(kind=4):: h,x,sum,pi
integer:: n,i
real(kind=4):: f
f(x) = 4.0/(1.0+x**2)
n = 2100000000
h= 1.0 / n
sum = 0.0
DO i=1, n
x = h * (i-0.5)
sum = sum + f(x)
END DO
pi = h * sum
write(*,*) 'Pi=',pi
end program calcpi
! { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } }
! { dg-final { cleanup-tree-dump "vect" } }