public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/35810]  New: [F2003] Automatic reallocation on assignment to allocatable variables
@ 2008-04-03  8:55 burnus at gcc dot gnu dot org
  2008-10-28 17:39 ` [Bug fortran/35810] [TR 15581 / F2003] " burnus at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-04-03  8:55 UTC (permalink / raw)
  To: gcc-bugs

The following is invalid Fortran 95 but valid Fortran 2003 as the variable is
reallocated:

integer, allocatable :: a(:)
allocate(a(1))
print *, size(a)
a = [1,2,3]  ! Implicit reallocation.
! Wrong: a(:) = [1,2,3] ! Out of bounds 1 vs. 3
print *, size(a)
end

The Intel compiler already supports this option. It provides the option -assume
[no]realloc_lhs to switch the support on/off. "Off" is useful for bound checks
and makes the program faster as the bounds do not need to be checked in that
case.

See also the comp.lang.fortran post at:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/7d5d1e7f4a48071c/7c63fef65ba5ea70?lnk=gst&q=realloc_lhs


-- 
           Summary: [F2003] Automatic reallocation on assignment to
                    allocatable variables
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org
OtherBugsDependingO 20585
             nThis:


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


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

end of thread, other threads:[~2011-02-02 18:23 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-35810-4@http.gcc.gnu.org/bugzilla/>
2010-10-08 16:29 ` [Bug fortran/35810] [TR 15581 / F2003] Automatic reallocation on assignment to allocatable variables burnus at gcc dot gnu.org
2010-10-25 22:23 ` burnus at gcc dot gnu.org
2010-11-28 14:35 ` pault at gcc dot gnu.org
2010-12-30 12:18 ` janus at gcc dot gnu.org
2011-01-27 22:40 ` burnus at gcc dot gnu.org
2011-01-28 14:36 ` pault at gcc dot gnu.org
2011-01-28 15:16 ` burnus at gcc dot gnu.org
2011-01-28 15:18 ` burnus at gcc dot gnu.org
2011-01-28 15:48 ` burnus at gcc dot gnu.org
2011-01-30 18:19 ` pault at gcc dot gnu.org
2011-02-02 18:11 ` dnovillo at gcc dot gnu.org
2011-02-02 18:23 ` dnovillo at gcc dot gnu.org
2008-04-03  8:55 [Bug fortran/35810] New: [F2003] " burnus at gcc dot gnu dot org
2008-10-28 17:39 ` [Bug fortran/35810] [TR 15581 / F2003] " burnus at gcc dot gnu dot org
2008-11-10 19:47 ` pault at gcc dot gnu dot org
2008-11-28 13:30 ` mikael at gcc dot gnu dot org
2009-06-08  9:11 ` burnus at gcc dot gnu dot org
2009-08-07 19:27 ` kargl at gcc dot gnu dot org
2009-10-16 20:23 ` burnus at gcc dot gnu dot org
2010-03-31 18:05 ` burnus at gcc dot gnu dot org
2010-08-14  9:04 ` burnus 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).