public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/43388] New: [F2008][OOP] ALLOCATE with MOLD=
@ 2010-03-16 12:46 burnus at gcc dot gnu dot org
2010-03-16 13:59 ` [Bug fortran/43388] " burnus at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-03-16 12:46 UTC (permalink / raw)
To: gcc-bugs
F2003 supported
ALLOCATE( A, SOURCE=B)
where the dynamic type of B determined the dynamic type of A plus where the
values where copied from B to A.
Fortran 2008 now also offers MOLD= where only the type is used, but no data is
copied.
Fortran 2008 draft FDIS: ftp://ftp.nag.co.uk/sc22wg5/N1801-N1850/N1814.pdf
R626 allocate-stmt is ALLOCATE ( [ type-spec :: ] allocation-list [,
alloc-opt-list ] )
R627 alloc-opt is ERRMSG = errmsg-variable
or MOLD = source-expr
or SOURCE = source-expr
or STAT = stat-variable
"If MOLD= appears and source-expr is a variable, its value need not be
defined."
And in the introduction one finds the following:
"A structure constructor can omit the value for an allocatable component.
SOURCE= in an ALLOCATE statement can give an array variable the bounds as well
as the value of an expression. MOLD= in an ALLOCATE statement can give a
polymorphic variable the shape, type, and type parameters of an expression
without copying the value."
--
Summary: [F2008][OOP] ALLOCATE with MOLD=
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43388
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/43388] [F2008][OOP] ALLOCATE with MOLD=
2010-03-16 12:46 [Bug fortran/43388] New: [F2008][OOP] ALLOCATE with MOLD= burnus at gcc dot gnu dot org
@ 2010-03-16 13:59 ` burnus at gcc dot gnu dot org
2010-06-13 2:47 ` janus at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-03-16 13:59 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from burnus at gcc dot gnu dot org 2010-03-16 13:58 -------
Found the right spot in the standard (well, actually Bill Long did):
"if source-expr is specified, each allocate-object is allocated with the
dynamic type and type parameter values of source-expr; otherwise, each
allocate-object is allocated with its dynamic type the same as its declared
type."
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43388
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/43388] [F2008][OOP] ALLOCATE with MOLD=
2010-03-16 12:46 [Bug fortran/43388] New: [F2008][OOP] ALLOCATE with MOLD= burnus at gcc dot gnu dot org
2010-03-16 13:59 ` [Bug fortran/43388] " burnus at gcc dot gnu dot org
@ 2010-06-13 2:47 ` janus at gcc dot gnu dot org
2010-06-15 18:35 ` janus at gcc dot gnu dot org
2010-06-15 18:43 ` janus at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: janus at gcc dot gnu dot org @ 2010-06-13 2:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from janus at gcc dot gnu dot org 2010-06-13 02:46 -------
I'll assign this to myself (working on a patch ...)
--
janus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |janus at gcc dot gnu dot org
|dot org |
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-06-13 02:46:52
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43388
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/43388] [F2008][OOP] ALLOCATE with MOLD=
2010-03-16 12:46 [Bug fortran/43388] New: [F2008][OOP] ALLOCATE with MOLD= burnus at gcc dot gnu dot org
2010-03-16 13:59 ` [Bug fortran/43388] " burnus at gcc dot gnu dot org
2010-06-13 2:47 ` janus at gcc dot gnu dot org
@ 2010-06-15 18:35 ` janus at gcc dot gnu dot org
2010-06-15 18:43 ` janus at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: janus at gcc dot gnu dot org @ 2010-06-15 18:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from janus at gcc dot gnu dot org 2010-06-15 18:35 -------
Subject: Bug 43388
Author: janus
Date: Tue Jun 15 18:33:58 2010
New Revision: 160801
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160801
Log:
2010-06-15 Janus Weil <janus@gcc.gnu.org>
PR fortran/43388
* gfortran.h (gfc_expr): Add new member 'mold'.
* match.c (gfc_match_allocate): Implement the MOLD tag.
* resolve.c (resolve_allocate_expr): Ditto.
* trans-stmt.c (gfc_trans_allocate): Ditto.
2010-06-15 Janus Weil <janus@gcc.gnu.org>
PR fortran/43388
* gfortran.dg/allocate_alloc_opt_8.f90: New.
* gfortran.dg/allocate_alloc_opt_9.f90: New.
* gfortran.dg/allocate_alloc_opt_10.f90: New.
* gfortran.dg/class_allocate_2.f03: Modified an error message.
Added:
trunk/gcc/testsuite/gfortran.dg/allocate_alloc_opt_10.f90
trunk/gcc/testsuite/gfortran.dg/allocate_alloc_opt_8.f90
trunk/gcc/testsuite/gfortran.dg/allocate_alloc_opt_9.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/match.c
trunk/gcc/fortran/resolve.c
trunk/gcc/fortran/trans-stmt.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/class_allocate_2.f03
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43388
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug fortran/43388] [F2008][OOP] ALLOCATE with MOLD=
2010-03-16 12:46 [Bug fortran/43388] New: [F2008][OOP] ALLOCATE with MOLD= burnus at gcc dot gnu dot org
` (2 preceding siblings ...)
2010-06-15 18:35 ` janus at gcc dot gnu dot org
@ 2010-06-15 18:43 ` janus at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: janus at gcc dot gnu dot org @ 2010-06-15 18:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from janus at gcc dot gnu dot org 2010-06-15 18:42 -------
Fixed with r160801. Remaining problems are tracked by PR 44541.
--
janus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43388
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-06-15 18:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-16 12:46 [Bug fortran/43388] New: [F2008][OOP] ALLOCATE with MOLD= burnus at gcc dot gnu dot org
2010-03-16 13:59 ` [Bug fortran/43388] " burnus at gcc dot gnu dot org
2010-06-13 2:47 ` janus at gcc dot gnu dot org
2010-06-15 18:35 ` janus at gcc dot gnu dot org
2010-06-15 18:43 ` janus 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).