re PR fortran/64952 (Missing temporary in assignment from elemental function)
authorPaul Thomas <pault@gcc.gnu.org>
Mon, 23 Mar 2015 07:53:31 +0000 (07:53 +0000)
committerMikael Morin <mikael@gcc.gnu.org>
Mon, 23 Mar 2015 07:53:31 +0000 (07:53 +0000)
commit30c931de07f8fcbe4ef3b550633c274fe7828975
tree59f7139307675a6ddd88e7d11153ba3460ac0019
parentaf3eb1106883dffe6b1164070a00ad0c14df1146
re PR fortran/64952 (Missing temporary in assignment from elemental function)

2015-03-23  Paul Thomas  <pault@gcc.gnu.org>
    Mikael Morin  <mikael@gcc.gnu.org>

PR fortran/64952
fortran/
* gfortran.h (struct symbol_attribute) : New field
'array_outer_dependency'.
* trans.h (struct gfc_ss_info): New field 'array_outer_dependency'.
* module.c (enum ab_attribute): New value AB_ARRAY_OUTER_DEPENDENCY.
(attr_bits): Append same value to initializer.
(mio_symbol_attribute): Handle 'array_outer_dependency' attr
in module read and write.
* resolve.c (update_current_proc_outer_array_dependency): New function.
(resolve_function, resolve_call): Add code to update current procedure's
'array_outer_dependency' attribute.
(resolve_variable): Mark current procedure with attribute
array_outer_dependency if the variable is an array coming from outside
the current namespace.
(resolve_fl_procedure): Mark a procedure without body with attribute
'array_outer_dependency'.
* trans-array.c (gfc_conv_resolve_dependencies): If any ss is
marked as 'array_outer_dependency' generate a temporary.
(gfc_walk_function_expr): If the function may reference external arrays,
mark the head gfc_ss with flag 'array_outer_dependency'.
testsuite/
* gfortran.dg/elemental_dependency_4.f90: New.
* gfortran.dg/elemental_dependency_5.f90: New.

Co-Authored-By: Mikael Morin <mikael@gcc.gnu.org>
From-SVN: r221586
gcc/fortran/ChangeLog
gcc/fortran/gfortran.h
gcc/fortran/module.c
gcc/fortran/resolve.c
gcc/fortran/trans-array.c
gcc/fortran/trans.h
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/elemental_dependency_4.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/elemental_dependency_5.f90 [new file with mode: 0644]