aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2014-02-09 19:45:06 +0000
committerPaul Thomas <pault@gcc.gnu.org>2014-02-09 19:45:06 +0000
commit56c78e5c22f59741aba3aac3fa89452895be36bf (patch)
treebb0721638c4b44251517f88b2484f1ddd20eda41 /gcc/fortran/trans-expr.c
parent5a47e4c519a94e176d66ca803b1ca82e9e8cefc4 (diff)
downloadgcc-56c78e5c22f59741aba3aac3fa89452895be36bf.zip
gcc-56c78e5c22f59741aba3aac3fa89452895be36bf.tar.gz
gcc-56c78e5c22f59741aba3aac3fa89452895be36bf.tar.bz2
re PR fortran/59026 (ELEMENTAL procedure with VALUE arguments emits wrong code)
2014-02-09 Paul Thomas <pault@gcc.gnu.org> PR fortran/59026 * trans-expr.c (gfc_conv_procedure_call): Pass the value of the actual argument to a formal argument with the value attribute in an elemental procedure. 2014-02-09 Paul Thomas <pault@gcc.gnu.org> PR fortran/59026 * gfortran.dg/elemental_by_value_1.f90 : New test From-SVN: r207645
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 12da0a0..297ff67 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -4047,7 +4047,11 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
gfc_init_se (&parmse, se);
parm_kind = ELEMENTAL;
- gfc_conv_expr_reference (&parmse, e);
+ if (fsym && fsym->attr.value)
+ gfc_conv_expr (&parmse, e);
+ else
+ gfc_conv_expr_reference (&parmse, e);
+
if (e->ts.type == BT_CHARACTER && !e->rank
&& e->expr_type == EXPR_FUNCTION)
parmse.expr = build_fold_indirect_ref_loc (input_location,