[Bug tree-optimization/53852] [4.8 Regression] -ftree-loop-linear: large compile time / memory usage

Joost.VandeVondele at mat dot ethz.ch gcc-bugzilla@gcc.gnu.org
Wed Aug 22 11:58:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53852

--- Comment #5 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> 2012-08-22 11:58:00 UTC ---
simplified testcase and some analysis:

SUBROUTINE  build_d_tensor_gks(d5f,v,d5)
    INTEGER, PARAMETER :: dp=8
    REAL(KIND=dp),  DIMENSION(3, 3, 3, 3, 3), &
      INTENT(OUT) :: d5f
    REAL(KIND=dp), DIMENSION(3), INTENT(IN)  :: v
    REAL(KIND=dp), INTENT(IN) :: d5
    INTEGER       :: k1, k2, k3, k4, k5
    REAL(KIND=dp) :: w

    d5f = 0.0_dp
    DO k1=1,3
       DO k2=1,3
          DO k3=1,3
             DO k4=1,3
                DO k5=1,3
                   d5f(k5,k4,k3,k2,k1)=d5f(k5,k4,k3,k2,k1)+ &
                          v(k1)*v(k2)*v(k3)*v(k4)*v(k5)*d5
                ENDDO
                w=v(k1)*v(k2)*v(k3)*d4
                d5f(k1,k2,k3,k4,k4)=d5f(k1,k2,k3,k4,k4)+w
                d5f(k1,k2,k4,k3,k4)=d5f(k1,k2,k4,k3,k4)+w
                d5f(k1,k4,k2,k3,k4)=d5f(k1,k4,k2,k3,k4)+w
                d5f(k4,k1,k2,k3,k4)=d5f(k4,k1,k2,k3,k4)+w
                d5f(k1,k2,k4,k4,k3)=d5f(k1,k2,k4,k4,k3)+w
             !  d5f(k1,k4,k2,k4,k3)=d5f(k1,k4,k2,k4,k3)+w
             !  d5f(k4,k1,k2,k4,k3)=d5f(k4,k1,k2,k4,k3)+w
             !  d5f(k1,k4,k4,k2,k3)=d5f(k1,k4,k4,k2,k3)+w
             !  d5f(k4,k1,k4,k2,k3)=d5f(k4,k1,k4,k2,k3)+w
             !  d5f(k4,k4,k1,k2,k3)=d5f(k4,k4,k1,k2,k3)+w
             ENDDO
          ENDDO
       ENDDO
    ENDDO
  END SUBROUTINE build_d_tensor_gks


the issue is that the compile time grows exponentially in the number of
uncommented lines of the d5f=d5f+w type:

1 0m1.112s
2 0m4.448s
3 0m11.513s
4 0m21.514s
5 0m35.529s



More information about the Gcc-bugs mailing list