public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/29642] New: Fortran 2003: VALUE Attribute (call by value not call by reference for actual arguments)
@ 2006-10-30 9:35 burnus at gcc dot gnu dot org
2006-10-31 5:29 ` [Bug fortran/29642] " pault at gcc dot gnu dot org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-10-30 9:35 UTC (permalink / raw)
To: gcc-bugs
This is already supported by a large number of compilers (e.g. sunf95, NAG f95,
ifort, g95).
gfortran gives: Syntax error in data declaration
Example:
subroutine foo(i)
implicit none
integer, value :: i
print *, i
end subroutine foo
>From the Fortran 2003 standard:
"5.1.2.15 VALUE attribute
The VALUE attribute specifies a type of argument association (12.4.1.2) for a
dummy argument."
And in
"12.4.1.2 Actual arguments associated with dummy data objects"
"If the dummy argument has the VALUE attribute it becomes associated with a
definable anonymous data object whose initial value is that of the actual
argument. Subsequent changes to the value or definition status of the dummy
argument do not affect the actual argument."
"NOTE 12.22
Fortran argument association is usually similar to call by reference and call
by value-result. If the VALUE attribute is specified, the effect is as if the
actual argument is assigned to a temporary, and the temporary is then argument
associated with the dummy argument. The actual mechanism by which this happens
is determined by the processor."
--
Summary: Fortran 2003: VALUE Attribute (call by value not call by
reference for actual arguments)
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
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29642
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/29642] Fortran 2003: VALUE Attribute (call by value not call by reference for actual arguments)
2006-10-30 9:35 [Bug fortran/29642] New: Fortran 2003: VALUE Attribute (call by value not call by reference for actual arguments) burnus at gcc dot gnu dot org
@ 2006-10-31 5:29 ` pault at gcc dot gnu dot org
2006-10-31 5:30 ` pault at gcc dot gnu dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-10-31 5:29 UTC (permalink / raw)
To: gcc-bugs
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-10-31 05:29:30
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29642
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/29642] Fortran 2003: VALUE Attribute (call by value not call by reference for actual arguments)
2006-10-30 9:35 [Bug fortran/29642] New: Fortran 2003: VALUE Attribute (call by value not call by reference for actual arguments) burnus at gcc dot gnu dot org
2006-10-31 5:29 ` [Bug fortran/29642] " pault at gcc dot gnu dot org
@ 2006-10-31 5:30 ` pault at gcc dot gnu dot org
2006-11-13 18:39 ` pault at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-10-31 5:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pault at gcc dot gnu dot org 2006-10-31 05:30 -------
Confirmed
Paul
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2006-10-31 05:29:30 |2006-10-31 05:30:08
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29642
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/29642] Fortran 2003: VALUE Attribute (call by value not call by reference for actual arguments)
2006-10-30 9:35 [Bug fortran/29642] New: Fortran 2003: VALUE Attribute (call by value not call by reference for actual arguments) burnus at gcc dot gnu dot org
2006-10-31 5:29 ` [Bug fortran/29642] " pault at gcc dot gnu dot org
2006-10-31 5:30 ` pault at gcc dot gnu dot org
@ 2006-11-13 18:39 ` pault at gcc dot gnu dot org
2006-11-14 10:01 ` patchapp at dberlin dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-11-13 18:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pault at gcc dot gnu dot org 2006-11-13 18:39 -------
Created an attachment (id=12608)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12608&action=view)
Implementation of VALUE and three testcases
This patch is regtesting as I write; I have to leave right now, so I will not
see the confirmation until tomorrow. I will submit in the next 24hours.
Paul
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pault at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29642
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/29642] Fortran 2003: VALUE Attribute (call by value not call by reference for actual arguments)
2006-10-30 9:35 [Bug fortran/29642] New: Fortran 2003: VALUE Attribute (call by value not call by reference for actual arguments) burnus at gcc dot gnu dot org
` (2 preceding siblings ...)
2006-11-13 18:39 ` pault at gcc dot gnu dot org
@ 2006-11-14 10:01 ` patchapp at dberlin dot org
2006-12-03 7:18 ` pault at gcc dot gnu dot org
2006-12-03 12:45 ` pault at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: patchapp at dberlin dot org @ 2006-11-14 10:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from patchapp at dberlin dot org 2006-11-14 10:00 -------
Subject: Bug number PR29642
A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-11/msg00923.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29642
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/29642] Fortran 2003: VALUE Attribute (call by value not call by reference for actual arguments)
2006-10-30 9:35 [Bug fortran/29642] New: Fortran 2003: VALUE Attribute (call by value not call by reference for actual arguments) burnus at gcc dot gnu dot org
` (3 preceding siblings ...)
2006-11-14 10:01 ` patchapp at dberlin dot org
@ 2006-12-03 7:18 ` pault at gcc dot gnu dot org
2006-12-03 12:45 ` pault at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-12-03 7:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pault at gcc dot gnu dot org 2006-12-03 07:18 -------
Subject: Bug 29642
Author: pault
Date: Sun Dec 3 07:18:22 2006
New Revision: 119461
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119461
Log:
2006-12-03 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29642
* trans-expr.c (gfc_conv_variable): A character expression with
the VALUE attribute needs an address expression; otherwise all
other expressions with this attribute must not be dereferenced.
(gfc_conv_function_call): Pass expressions with the VALUE
attribute by value, using gfc_conv_expr.
* symbol.c (check_conflict): Add strings for INTENT OUT, INOUT
and VALUE. Apply all the constraints associated with the VALUE
attribute.
(gfc_add_value): New function.
(gfc_copy_attr): Call it for VALUE attribute.
* decl.c (match_attr_spec): Include the VALUE attribute.
(gfc_match_value): New function.
* dump-parse-tree.c (gfc_show_attr): Include VALUE.
* gfortran.h : Add value to the symbol_attribute structure and
add a prototype for gfc_add_value
* module.c (mio_internal_string): Include AB_VALUE in enum.
(attr_bits): Provide the VALUE string for it.
(mio_symbol_attribute): Read or apply the VLUE attribute.
* trans-types.c (gfc_sym_type): Variables with the VLAUE
attribute are not passed by reference!
* resolve.c (was_declared): Add value to those that return 1.
(resolve_symbol): Value attribute requires dummy attribute.
* match.h : Add prototype for gfc_match_public.
* parse.c (decode_statement): Try to match a VALUE statement.
2006-12-03 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29642
* gfortran.dg/value_1.f90 : New test.
* gfortran.dg/value_2.f90 : New test.
* gfortran.dg/value_3.f90 : New test.
* gfortran.dg/value_4.f90 : New test.
* gfortran.dg/value_4.c : Called from value_4.f90.
Added:
trunk/gcc/testsuite/gfortran.dg/value_1.f90
trunk/gcc/testsuite/gfortran.dg/value_2.f90
trunk/gcc/testsuite/gfortran.dg/value_3.f90
trunk/gcc/testsuite/gfortran.dg/value_4.c
trunk/gcc/testsuite/gfortran.dg/value_4.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/decl.c
trunk/gcc/fortran/dump-parse-tree.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/match.h
trunk/gcc/fortran/module.c
trunk/gcc/fortran/parse.c
trunk/gcc/fortran/resolve.c
trunk/gcc/fortran/symbol.c
trunk/gcc/fortran/trans-expr.c
trunk/gcc/fortran/trans-types.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29642
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug fortran/29642] Fortran 2003: VALUE Attribute (call by value not call by reference for actual arguments)
2006-10-30 9:35 [Bug fortran/29642] New: Fortran 2003: VALUE Attribute (call by value not call by reference for actual arguments) burnus at gcc dot gnu dot org
` (4 preceding siblings ...)
2006-12-03 7:18 ` pault at gcc dot gnu dot org
@ 2006-12-03 12:45 ` pault at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-12-03 12:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pault at gcc dot gnu dot org 2006-12-03 12:45 -------
Fixed in 4.3
Paul
--
pault at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29642
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-12-03 12:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-30 9:35 [Bug fortran/29642] New: Fortran 2003: VALUE Attribute (call by value not call by reference for actual arguments) burnus at gcc dot gnu dot org
2006-10-31 5:29 ` [Bug fortran/29642] " pault at gcc dot gnu dot org
2006-10-31 5:30 ` pault at gcc dot gnu dot org
2006-11-13 18:39 ` pault at gcc dot gnu dot org
2006-11-14 10:01 ` patchapp at dberlin dot org
2006-12-03 7:18 ` pault at gcc dot gnu dot org
2006-12-03 12:45 ` pault 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).