[Bug fortran/38135] RESHAPE gives wrong result

tkoenig at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Nov 16 09:05:00 GMT 2008



------- Comment #3 from tkoenig at gcc dot gnu dot org  2008-11-16 09:04 -------
Simplified test case (without the second reshape):

The problem appears to be the empty SOURCE with the presence of PAD.

$ cat bar.f90
program main
  integer, parameter :: N = 3
  integer :: A(N,N)
  integer :: b(n+1)

  b = (/ 1, 2, 2, 2 /)

  A(1:N,1:N)=reshape(A(1:0,1),(/N,N/),b)
  write(*,'(3i5)') A

end program main
$ gfortran bar.f90
$ ./a.out
    1*****    1
*****    1*****
    1*****    1


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-11-16 09:04:10
               date|                            |
            Summary|FORALL gives wrong result   |RESHAPE gives wrong result


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



More information about the Gcc-bugs mailing list