view gcc/testsuite/gfortran.dg/realloc_on_assign_19.f90 @ 120:f93fa5091070

fix conv1.c
author mir3636
date Thu, 08 Mar 2018 14:53:42 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { dg-do compile }
! { dg-options "-fdump-tree-original" }
! PR 52243 - avoid check for reallocation when doing simple
! assignments with the same variable on both sides.
module  foo
contains
  elemental function ele(a)
    real, intent(in) :: a
    real :: ele
    ele = 1./(2+a)
  end function ele

  subroutine bar(a)
    real, dimension(:), allocatable :: a
    a = a * 2.0
    a = sin(a-0.3)
    a = ele(a)
  end subroutine bar
end module foo
! { dg-final { scan-tree-dump-times "alloc" 0 "original" } }