This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: reshape is segfaulting the code


On Tue, May 10, 2005 at 12:21:18AM +0300, Janne Blomqvist wrote:
> On Mon, May 09, 2005 at 01:57:31PM -0400, Kamaraju Kusumanchi wrote:

> > program reshape_bug
> >   implicit none
> >   integer, parameter :: NX = 2, NY = 2, NZ = 2**4
> >   integer, parameter :: DPC = kind((1.0D0, 1.0D0))
> >   complex(DPC) :: fftw_output(0:NX, 0:NY, 0:NZ-1)
> >   
> >   fftw_output = cmplx(0.0D0, 0.0D0)
> >   fftw_output(0:NX-1, 0:NY-1, 0:NZ-1) = reshape( reshape( &
> >   fftw_output(0:NX-1, 0:NY-1, 0:NZ-1), (/NX*NY, NZ/), &
> >   order=(/1,2/)), (/NX, NY, NZ/))
> > end program reshape_bug

> > This code compiles fine. But it is giving a segmentation fault when
> > executed. The code compiles fine with ifort 8.1, absoft 8.0 on a
> > machine running Debian sid.
> 
> > Is this is a known bug? If not, can someone reduce the testcase (as it
> > looks complicated enough already)? I can report the bug if no
> > reduction is necessary.
> 
> Without looking at the code itself any further, I suspect it might be
> related to PR 21127

Without actually having tried this, I think this sould be fixed
by the patch for PR 21127 for mainline (the temporary allocation
patch for reshape hasn't been backported to 4.0 yet).


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