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

            Bug ID: 60834
           Summary: [OOP] ICE with ASSOCIATE  construct
                    (gimplify_var_or_parm_decl, at gimplify.c:1721)
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org

The following code ICEs with -O1 but not with -O0:


module m
  implicit none
  type :: t
    real :: diffusion=1.
  end type
contains
  subroutine solve(this, x)
    class(t), intent(in) :: this
    real, intent(in) :: x(:)
    integer :: i
    integer, parameter :: n(1:5)=[(i,i=1, 5)]

    associate( nu=>this%diffusion)
      associate( exponential=>exp(-(x(i)-n) ))
        do i = 1, size(x)
        end do
      end associate
    end associate
  end subroutine solve
end module m

Reply via email to