From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7490 invoked by alias); 1 Jul 2008 05:22:59 -0000 Received: (qmail 7064 invoked by uid 48); 1 Jul 2008 05:22:11 -0000 Date: Tue, 01 Jul 2008 05:22:00 -0000 Subject: [Bug fortran/36683] New: -fbounds-check failure for allocated array and spread X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "terry at chem dot gu dot se" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-07/txt/msg00010.txt.bz2 Unconformable array operations are not being picked up in the following: [tjf@rscpc28 Stoopid]$ cat badness.f90 program fred implicit none real,dimension(:,:),allocatable::A real,dimension(5)::v allocate(A(5,5)) A=5 v=5 A=A/spread(v,2,3) write(*,*)A(1,:) write(*,*)A(2,:) write(*,*)A(3,:) write(*,*)A(4,:) write(*,*)A(5,:) end [tjf@rscpc28 Stoopid]$ gfortran -Wall -O0 -W -Wtabs -g -fbounds-check -o badness badness.f90 [tjf@rscpc28 Stoopid]$ ./badness 1.00000000 1.00000000 1.00000000 5.0000000 5.0000000 1.00000000 1.00000000 1.00000000 5.0000000 5.0000000 1.00000000 1.00000000 1.00000000 5.0000000 5.0000000 1.00000000 1.00000000 1.00000000 5.0000000 5.0000000 1.00000000 1.00000000 1.00000000 5.0000000 5.0000000 [tjf@rscpc28 Stoopid]$ gfortran -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../gcc-4.3-20080522/configure --disable-multilib --enable-languages=c,c++,fortran Thread model: posix gcc version 4.3.1 20080522 (prerelease) (GCC) Making the spread array too big [spread(v,2,13)] is not detected either. My quick attempts to do both in a single code caused glibc to freak out with "double free or corruption" detection. -- Summary: -fbounds-check failure for allocated array and spread Product: gcc Version: 4.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: terry at chem dot gu dot se GCC host triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36683