------- Comment #4 from kargl at gcc dot gnu dot org  2010-04-28 23:06 -------
(In reply to comment #3)
> Subject: Re:  [4.6 Regression] FAIL:
>         gfortran.dg/array_constructor_11.f90
> 
> Looks like latent problem that we fail when optimiznig for size.  
> 

It appears to be an in-lining issue.  This reduced case

program main
  implicit none
  call build (77)
contains
  subroutine build (order)
    integer :: order, i, j

    call test (1, order, 3,  (/ (i, i = 1, order, 3) /))
    call test (order, 1, -3, (/ (i, i = order, 1, -3) /))

    do j = 0, 1
      call test (order + j, order, 5,  (/ (i, i = order + j, order, 5) /))
    end do

  end subroutine build

  subroutine test (from, to, step, values)
    integer, dimension (:) :: values
    integer :: from, to, step, last, i

    last = 0
    do i = from, to, step
      last = last + 1
      if (values (last) .ne. i) call abort
    end do
    if (size (values, dim = 1) .ne. last) call abort
  end subroutine test

end program main

gives
laptop:kargl[230] gfc4x -c -g -O3 array_constructor_11.f90
array_constructor_11.f90:6:0: internal compiler error: in output_die, at
dwarf2out.c:10649
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
laptop:kargl[231] gfc4x -c -g -O3 -fno-inline array_constructor_11.f90

where the last command succeeds.

Note, if I remove any one of the calls to test() or remove either
if-statement within test(), the ICE goes away.


-- 


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

Reply via email to