https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68576
--- Comment #3 from majun <majun4950646 at 163 dot com> --- (In reply to Richard Biener from comment #2) > I think the issue is that with respect to loop 4 the evolution is > > _76 = { 1 + _373, + , 1 }_4 > > but with all the casting we end up with > > (set_scalar_evolution > instantiated_below = 5 > (scalar = _470) > (scalar_evolution = {(unsigned long) stride.92_29 + (unsigned long) > offset.93_35, +, (unsigned long) stride.92_29}_1)) > ) > > and instantiate_scev for the SCEV above fails. Likewise for instantiate > below 10, only below 15 succeeds in the end. Yes,it failed in CASE_CONVERT while do instantiate_scev_r. BTW, another example is interchange-1.f: --- subroutine foo(f1,f2,f3,f4,f5,f6,f7,f8,f9,f0,g1,g2,g3) implicit none integer f4,f3,f2,f1 integer g4,g5,g6,g7,g8,g9 integer i1,i2,i3,i4,i5 real*8 g1(5,f3,f2,f1),g2(5,5,f3,f2,f1),g3(5,f3,f2,f1) real*8 f0(5,5,f3,f2,f1),f9(5,5,f3,f2,f1),f8(5,5,f3,f2,f1) real*8 f7(5,5,f3,f2,f1),f6(5,5,f3,f2,f1),f5(5,5,f3,f2,f1) do i3=1,f1 g8=mod(i3+f1-2,f1)+1 g9=mod(i3,f1)+1 do i4=1,f2 g6=mod(i4+f2-2,f2)+1 g7=mod(i4,f2)+1 do i5=1,f3 g4=mod(i5+f3-2,f3)+1 g5=mod(i5,f3)+1 do i1=1,5 g3(i1,i5,i4,i3)=0.0d0 do i2=1,5 g3(i1,i5,i4,i3)=g3(i1,i5,i4,i3)+ 1 g2(i1,i2,i5,i4,i3)*g1(i2,i5,i4,i3)+ 2 f0(i1,i2,i5,i4,i3)*g1(i2,g5,i4,i3)+ 3 f9(i1,i2,i5,i4,i3)*g1(i2,i5,g7,i3)+ 4 f8(i1,i2,i5,i4,i3)*g1(i2,i5,i4,g9)+ 5 f7(i1,i2,i5,i4,i3)*g1(i2,g4,i4,i3)+ 6 f6(i1,i2,i5,i4,i3)*g1(i2,i5,g6,i3)+ 7 f5(i1,i2,i5,i4,i3)*g1(i2,i5,i4,g8) enddo enddo enddo enddo enddo return end --- the innermost 2 loops have constant loop bound, and this example can paralle in the 2nd loop instead of 3rd loop. so,any plan to improve CASE_CONVERT or type casting in instantiate_scev ? Thanks! ---Jun