public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/27524]  New: -fbounds-check interracts *strangely* with an array of size 1
@ 2006-05-09 19:10 P dot Schaffnit at access dot rwth-aachen dot de
  2006-05-10 11:34 ` [Bug fortran/27524] " P dot Schaffnit at access dot rwth-aachen dot de
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: P dot Schaffnit at access dot rwth-aachen dot de @ 2006-05-09 19:10 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-06-03 16:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-09 19:10 [Bug fortran/27524] New: -fbounds-check interracts *strangely* with an array of size 1 P dot Schaffnit at access dot rwth-aachen dot de
2006-05-10 11:34 ` [Bug fortran/27524] " P dot Schaffnit at access dot rwth-aachen dot de
2006-05-19 16:59 ` [Bug libfortran/27524] " fxcoudert at gcc dot gnu dot org
2006-05-24  9:21 ` fxcoudert at gcc dot gnu dot org
2006-05-24 20:53 ` [Bug libfortran/27524] -fbounds-check interacts with array function fxcoudert at gcc dot gnu dot org
2006-05-26 21:19 ` fxcoudert at gcc dot gnu dot org
2006-05-26 21:20 ` [Bug libfortran/27524] [4.1 only] " fxcoudert at gcc dot gnu dot org
2006-05-27  8:30 ` fxcoudert at gcc dot gnu dot org
2006-06-03 16:07 ` fxcoudert at gcc dot gnu dot org
2006-06-03 16:08 ` [Bug libfortran/27524] " fxcoudert at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).