------- Comment #3 from pault at gcc dot gnu dot org  2008-01-11 10:13 -------
I have had a brief attempt to resolve this one and have driven my head against
a brick wall!

Starting with this development of the original testcase:

! Rejects-valid. Fails with gfortran 4.1, 4.2 and 4.3
! For 4.3 the error message is:
!
!                (/ linem, nplam /) )
!                 1
!Error: Invalid character in name at (1)
!
! Found using the Fortran Company Fortran 90 Test Suite (Lite),
! Version 1.4
module splitprms
      integer, parameter  :: nplam = 3 ! # of plans to expand TABs
      integer, parameter  :: linem = 3 ! max. line length
      integer, parameter  :: ncntm = 39 ! max. # cont. lines
      integer, parameter, dimension (linem*nplam) :: check1 =   &
      [ max ([(i, i= 1,linem), (10*i, i= 1,linem)],             &
      [(6, i= 1, 2*linem) ]), [(i, i= 1,linem)]]

      integer, parameter, dimension (linem, nplam) :: check2 =  &
      reshape (check1, [linem, nplam ])

      integer, parameter, dimension (2) :: check3 =  [linem, nplam ]

! This is OK!!!!!!!!!
      integer, parameter, dimension (linem, nplam) :: check4 =  &
      reshape ([ max ([(i, i= 1,linem), (10*i, i= 1,linem)],    &
               [(6, i= 1, 2*linem) ]), [(i, i= 1,linem)]],      &
                check3 )
! This is not....
      integer, parameter, dimension (linem, nplam) :: nxttab =  &
      reshape ([ max ([(i, i= 1,linem), (10*i, i= 1,linem)],    &
               [(6, i= 1, 2*linem) ]), [(i, i= 1,linem)]],      &
               [linem, nplam ])
! This is the original
      integer, parameter, dimension (linem, nplam) :: nxttab2 = &
      reshape (                                                 &
               (/max ((/(6+3*((i-6+3)/3), i= 1,linem),          &
                        (6+2*((i-6+2)/2), i= 1,linem)/),        &
                      (/(6, i= 1, 2*linem)/)),                  &
                (/(i, i= 1,linem)/)/), (/ linem, nplam /) )
end module splitprms

Resolution of the 'reshape' function is being derailed for some reason by the
shape expression in gfc_simplify_reshape.  However, simplifying this does not
do the job but adding a gfc_simplify_expr in gfc_get_array_element fixes this
problem but breaks everything else!

*sigh*

Paul


-- 


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

Reply via email to