From: Richard Biener Date: Mon, 24 Apr 2017 11:57:53 +0000 (+0000) Subject: re PR fortran/80494 (ICE in wide_int_to_tree) X-Git-Tag: basepoints/gcc-9~7933 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f30a1190ffff2c7fd5df923dbae1c16549cb8575;p=thirdparty%2Fgcc.git re PR fortran/80494 (ICE in wide_int_to_tree) 2017-04-24 Richard Biener PR tree-optimization/80494 * tree-scalar-evolution.c (analyze_scalar_evolution_1): Bail out for complex types. * gfortran.dg/pr80494.f90: New testcase. From-SVN: r247095 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 86ec5c1a3f46..1a6f0006f935 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-04-24 Richard Biener + + PR tree-optimization/80494 + * tree-scalar-evolution.c (analyze_scalar_evolution_1): Bail + out for complex types. + 2017-04-24 Richard Biener * tree-ssa-sccvn.h (run_scc_vn): Adjust prototype. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 08ad07d3cd76..740de777e1cb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-04-24 Richard Biener + + PR tree-optimization/80494 + * gfortran.dg/pr80494.f90: New testcase. + 2017-04-24 Richard Biener PR tree-optimization/79725 diff --git a/gcc/testsuite/gfortran.dg/pr80494.f90 b/gcc/testsuite/gfortran.dg/pr80494.f90 new file mode 100644 index 000000000000..c619c0a06c95 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr80494.f90 @@ -0,0 +1,32 @@ +! { dg-do compile } +! { dg-options "-std=gnu -O2" } + +subroutine CalcCgr(C,rmax,ordgr_max) + integer, intent(in) :: rmax,ordgr_max + double complex :: Zadj(2,2), Zadj2(2,2) + double complex, intent(out) :: C(0:rmax,0:rmax,0:rmax) + double complex, allocatable :: Cexpgr(:,:,:,:) + double complex :: Caux + integer :: rmaxB,rmaxExp,r,n0,n1,n2,k,l,i,j,m,n,nn + + rmaxB = 2*rmax + rmaxExp = rmaxB + allocate(Cexpgr(0:rmaxExp/2,0:rmaxExp,0:rmaxExp,0:ordgr_max)) + + rloop: do r=0,rmaxExp/2 + do n0=r,1,-1 + do nn=r-n0,0,-1 + do i=1,2 + Caux = Caux - Zadj(i,l) + end do + Cexpgr(n0,0,0,0) = Caux/(2*(nn+1)) + end do + end do + do n1=0,r + n2 = r-n1 + if (r.le.rmax) then + C(0,n1,n2) = Cexpgr(0,n1,n2,0) + end if + end do + end do rloop +end subroutine CalcCgr diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index cbd17e8644fe..7327d4eed6b4 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -2049,7 +2049,9 @@ analyze_scalar_evolution_1 (struct loop *loop, tree var, tree res) basic_block bb; struct loop *def_loop; - if (loop == NULL || TREE_CODE (type) == VECTOR_TYPE) + if (loop == NULL + || TREE_CODE (type) == VECTOR_TYPE + || TREE_CODE (type) == COMPLEX_TYPE) return chrec_dont_know; if (TREE_CODE (var) != SSA_NAME)