From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3329 invoked by alias); 9 May 2006 19:10:32 -0000 Received: (qmail 3275 invoked by uid 48); 9 May 2006 19:10:25 -0000 Date: Tue, 09 May 2006 19:10:00 -0000 Subject: [Bug fortran/27524] New: -fbounds-check interracts *strangely* with an array of size 1 X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "P dot Schaffnit at access dot rwth-aachen dot de" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-05/txt/msg00937.txt.bz2 List-Id: Hi! I've spotted something quite strange with -fbounds-check and an array which happens to have a size of 1 (a quite unlikely configuration admitedly, but could be the tip of s(omething worse, worth investigating I guess). I was able to reproduce this behaviour with a small variation on Paul Thomas's example for PR 27124 (is it related to that in any way?)): if the size of the array is 1 *and* -fbounds-check is specified it returns some junk (1075191960 for me), and otherwise (I mean, another size of the array and/or without -fbounds-check) it returns the expected 10. Philippe PS: a small example exhibiting this behaviour: PROGRAM Test IMPLICIT NONE INTEGER, PARAMETER :: Array_Size = 1 INTEGER :: Array(Array_Size) Array = 100 Array = Function_Test ( Array, 10 ) WRITE ( 6, * ) Array CONTAINS FUNCTION Function_Test ( Array, Scalar ) INTEGER, INTENT(IN) :: Array(1:Array_Size), Scalar INTEGER :: Function_Test(1:Array_Size) Function_Test = Array / Scalar END FUNCTION Function_Test END PROGRAM Test PPS: how I start it: gfortran -g -fbounds-check Test.f90 -o Test ; ./Test PPPS: I'm using reasonably up-to-date sources: gfortran --v Using built-in specs. Target: i686-pc-linux-gnu Configured with: /USER/philippe/Irix/Gcc_Sources/configure --prefix=/usr1/MICRESS/Philippe/Tools/Gcc --enable-languages=c,fortran --disable-maintainer-mode --disable-shared --with-mpfr=usr1/MICRESS/Philippe/Tools/Mpfr --with-gmp=/usr1/MICRESS/Philippe/Tools/Gmp Thread model: posix gcc version 4.2.0 20060508 (experimental) -- Summary: -fbounds-check interracts *strangely* with an array of size 1 Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: P dot Schaffnit at access dot rwth-aachen dot de GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27524