Fix fortran scalar elemental dependency mishandling
authorMikael Morin <mikael@gcc.gnu.org>
Fri, 5 Feb 2016 21:41:15 +0000 (21:41 +0000)
committerMikael Morin <mikael@gcc.gnu.org>
Fri, 5 Feb 2016 21:41:15 +0000 (21:41 +0000)
commit711d7c231fc6a5a04f65568cf17a47c270527a09
tree6b50b567f3e7b484d1a22fbe37c2dcf74d0ad824
parent861c7bcd62bcbbf6e14311e18ba7293cc581e1ff
Fix fortran scalar elemental dependency mishandling

PR fortran/66089
gcc/fortran/
* trans-expr.c (expr_is_variable, gfc_expr_is_variable): Rename
the former to the latter and make it non-static.  Update callers.
* gfortran.h (gfc_expr_is_variable): New declaration.
(struct gfc_ss_info): Add field needs_temporary.
* trans-array.c (gfc_scalar_elemental_arg_saved_as_argument):
Tighten the condition on aggregate expressions with a check
that the expression is a variable and doesn't need a temporary.
(gfc_conv_resolve_dependency): Add intermediary reference variable.
Set the needs_temporary field.
gcc/testsuite/
* gfortran.dg/elemental_dependency_6.f90: New.

From-SVN: r233188
gcc/fortran/ChangeLog
gcc/fortran/trans-array.c
gcc/fortran/trans-expr.c
gcc/fortran/trans.h
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/elemental_dependency_6.f90 [new file with mode: 0644]