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 fortran/34740] -fbounds-check with TRANSFER misses out of bounds in array assignment


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

Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2009-03-29 08:22:06         |2013-11-27
                 CC|                            |Joost.VandeVondele at mat dot ethz
                   |                            |.ch

--- Comment #1 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> ---
right... tripped over this in CP2K. Is found by g95.

I notice that the code:

SUBROUTINE S1()
   INTEGER, ALLOCATABLE, DIMENSION(:) :: a
   CHARACTER, ALLOCATABLE, DIMENSION(:) :: b
   ALLOCATE(a(20),b(20))
   write(6,*) SIZE(a),SIZE(b)
   a=TRANSFER(b,a)
   write(6,*) SIZE(a),SIZE(b)
END SUBROUTINE
CALL S1()
END

already does the right reallocation of a, so I'd guess some of the base work
has been done to produce a runtime error with -fcheck=bounds on 

SUBROUTINE S1()
   INTEGER, POINTER, DIMENSION(:) :: a
   CHARACTER, POINTER, DIMENSION(:) :: b
   ALLOCATE(a(20),b(20))
   write(6,*) SIZE(a),SIZE(b)
   a=TRANSFER(b,a)
   write(6,*) SIZE(a),SIZE(b)
END SUBROUTINE
CALL S1()
END


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