Bug 43928 - [4.6 Regression] FAIL: gfortran.dg/array_constructor_11.f90
Summary: [4.6 Regression] FAIL: gfortran.dg/array_constructor_11.f90
Status: RESOLVED DUPLICATE of bug 43924
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-28 21:16 UTC by H.J. Lu
Modified: 2010-04-28 23:06 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2010-04-28 21:16:31 UTC
On Linux/x86, revision 158788 gave

FAIL: gfortran.dg/array_constructor_11.f90  -O3 -g  (internal compiler error)
FAIL: gfortran.dg/array_constructor_11.f90  -O3 -g  (test for excess errors)

Revision 158783 is OK.
Comment 1 H.J. Lu 2010-04-28 21:18:40 UTC
It may be caused by revision 158788:

http://gcc.gnu.org/ml/gcc-cvs/2010-04/msg00895.html
Comment 2 kargls 2010-04-28 21:35:17 UTC

*** This bug has been marked as a duplicate of 43924 ***
Comment 3 Jan Hubicka 2010-04-28 22:20:21 UTC
Subject: Re:  [4.6 Regression] FAIL:
	gfortran.dg/array_constructor_11.f90

Looks like latent problem that we fail when optimiznig for size.  
Comment 4 kargls 2010-04-28 23:06:21 UTC
(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.