This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libfortran/21108] [4.0 only] reshape with order causes random results


------- Additional Comments From tkoenig at gcc dot gnu dot org  2005-04-23 18:09 -------
> I think you copy/pasted the wrong "working" testcase.

Yes, I did :-(

Here is a corrected version.

$ gfortran reshape-0.f90
$ ./a.out
Aborted
$ cat reshape-0.f90
! { dg-do run }
! This tests a few reshape PRs.
program resh
  implicit none
  real, dimension (2,3) :: a,c
  real, dimension (12) :: b
  integer :: i

  ! PR 21108:  This used to give undefined results.
  b = (/(i,i=1,12)/)
  a = reshape(b(1:12:2),shape(a),order=(/2,1/))
  c = reshape(b(1:12:2),shape(a),order=(/2,1/))
  if (any (a /= c)) call abort

end

$ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.0/configure --prefix=/home/ig25
--enable-languages=c,f95 --enable-checking
Thread model: posix
gcc version 4.0.1 20050423 (prerelease)

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.0.1
      Known to work|                            |4.1.0
            Summary|reshape with order causes   |[4.0 only] reshape with
                   |memory corruption           |order causes random results
   Target Milestone|---                         |4.0.1


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]