]> gcc.gnu.org Git - gcc.git/commit - gcc/fortran/decl.c
re PR fortran/29642 (Fortran 2003: VALUE Attribute (call by value not call by referen...
authorPaul Thomas <pault@gcc.gnu.org>
Sun, 3 Dec 2006 07:18:22 +0000 (07:18 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Sun, 3 Dec 2006 07:18:22 +0000 (07:18 +0000)
commit06469efd1a409d723093cfaa75ab9d39653e6463
tree2cc0f500bf05264d75beb5ac0011e36ce0619792
parent3c5e8e4492a4f360800bfc4d3965a5a85c230a08
re PR fortran/29642 (Fortran 2003: VALUE Attribute (call by value not call by reference for actual arguments))

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.

From-SVN: r119461
17 files changed:
gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/fortran/dump-parse-tree.c
gcc/fortran/gfortran.h
gcc/fortran/match.h
gcc/fortran/module.c
gcc/fortran/parse.c
gcc/fortran/resolve.c
gcc/fortran/symbol.c
gcc/fortran/trans-expr.c
gcc/fortran/trans-types.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/value_1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/value_2.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/value_3.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/value_4.c [new file with mode: 0644]
gcc/testsuite/gfortran.dg/value_4.f90 [new file with mode: 0644]
This page took 0.059351 seconds and 5 git commands to generate.