aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans.h
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2015-03-23 07:53:31 +0000
committerMikael Morin <mikael@gcc.gnu.org>2015-03-23 07:53:31 +0000
commit30c931de07f8fcbe4ef3b550633c274fe7828975 (patch)
tree59f7139307675a6ddd88e7d11153ba3460ac0019 /gcc/fortran/trans.h
parentaf3eb1106883dffe6b1164070a00ad0c14df1146 (diff)
downloadgcc-30c931de07f8fcbe4ef3b550633c274fe7828975.zip
gcc-30c931de07f8fcbe4ef3b550633c274fe7828975.tar.gz
gcc-30c931de07f8fcbe4ef3b550633c274fe7828975.tar.bz2
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
Diffstat (limited to 'gcc/fortran/trans.h')
-rw-r--r--gcc/fortran/trans.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 3ba2f88..be11363 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -226,6 +226,10 @@ typedef struct gfc_ss_info
/* Suppresses precalculation of scalars in WHERE assignments. */
unsigned where:1;
+ /* This set for an elemental function that contains expressions for
+ external arrays, thereby triggering creation of a temporary. */
+ unsigned array_outer_dependency:1;
+
/* Tells whether the SS is for an actual argument which can be a NULL
reference. In other words, the associated dummy argument is OPTIONAL.
Used to handle elemental procedures. */