------- Comment #2 from mikael at gcc dot gnu dot org 2008-12-30 14:04 ------- without derived types:
program gfcbu84_main ! use gfcbug84 implicit none integer :: jplev, k_lev real :: p(42) real, pointer :: q(:) jplev = 42 k_lev = 1 allocate (q(jplev)) call tq_tvgh (q(k_lev:), p(k_lev:)) contains elemental subroutine tq_tvgh (t, p) real ,intent (out) :: t real ,intent (in) :: p t=p end subroutine tq_tvgh end program gfcbu84_main The bound temporaries (D.1559,D.1560) are used before being defined. integer(kind=8) D.1560; integer(kind=8) D.1559; integer(kind=8) D.1558; real(kind=4)[0:] * D.1557; D.1563 = (integer(kind=8)) k_lev; D.1564 = q.dim[0].ubound; parm.2.dtype = 281; D.1566 = q.dim[0].stride; parm.2.dim[0].lbound = 1; parm.2.dim[0].ubound = (1 - D.1563) + D.1564; parm.2.dim[0].stride = NON_LVALUE_EXPR <D.1566>; parm.2.data = (void *) &(*(real(kind=4)[0:] *) q.data)[(D.1563 - q.dim[0].lbound) * D.1566]; parm.2.offset = 0; D.1569 = D.1560 - D.1559; atmp.3.dtype = 281; atmp.3.dim[0].stride = 1; atmp.3.dim[0].lbound = 0; atmp.3.dim[0].ubound = D.1569; (...) D.1559 = (integer(kind=8)) k_lev; D.1560 = q.dim[0].ubound; My commit is probably the culprit (what else?), but I don't understand how it could be. -- mikael at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |4.4.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38669