aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2007-01-27 18:23:14 +0000
committerPaul Thomas <pault@gcc.gnu.org>2007-01-27 18:23:14 +0000
commita00b8d1a38973eb176d7932bb2bd6cf7e59c5495 (patch)
tree5980c7b71db5312698ab4c49a4066d1da8d30e6b /gcc/fortran/resolve.c
parentea6244280b016b12843432c1381a2a9064f60d00 (diff)
downloadgcc-a00b8d1a38973eb176d7932bb2bd6cf7e59c5495.zip
gcc-a00b8d1a38973eb176d7932bb2bd6cf7e59c5495.tar.gz
gcc-a00b8d1a38973eb176d7932bb2bd6cf7e59c5495.tar.bz2
re PR fortran/30407 ([4.1 only] Elemental functions in WHERE assignments wrongly rejected)
2007-01-27 Paul Thomas <pault@gcc.gnu.org> PR fortran/30407 * trans-expr.c (gfc_conv_operator_assign): New function. * trans.h : Add prototype for gfc_conv_operator_assign. * trans-stmt.c (gfc_trans_where_assign): Add a gfc_symbol for a potential operator assignment subroutine. If it is non-NULL call gfc_conv_operator_assign instead of the first assignment. ( gfc_trans_where_2): In the case of an operator assignment, extract the argument expressions from the code for the subroutine call and pass the symbol to gfc_trans_where_assign. resolve.c (resolve_where, gfc_resolve_where_code_in_forall, gfc_resolve_forall_body): Resolve the subroutine call for operator assignments. 2007-01-27 Paul Thomas <pault@gcc.gnu.org> PR fortran/30407 * gfortran.dg/where_operator_assign_1.f90: New test. * gfortran.dg/where_operator_assign_2.f90: New test. * gfortran.dg/where_operator_assign_3.f90: New test. From-SVN: r121235
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 526be48..9a06a98 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -4550,6 +4550,11 @@ resolve_where (gfc_code *code, gfc_expr *mask)
"inconsistent shape", &cnext->expr->where);
break;
+
+ case EXEC_ASSIGN_CALL:
+ resolve_call (cnext);
+ break;
+
/* WHERE or WHERE construct is part of a where-body-construct */
case EXEC_WHERE:
resolve_where (cnext, e);
@@ -4750,6 +4755,11 @@ gfc_resolve_where_code_in_forall (gfc_code *code, int nvar,
case EXEC_ASSIGN:
gfc_resolve_assign_in_forall (cnext, nvar, var_expr);
break;
+
+ /* WHERE operator assignment statement */
+ case EXEC_ASSIGN_CALL:
+ resolve_call (cnext);
+ break;
/* WHERE or WHERE construct is part of a where-body-construct */
case EXEC_WHERE:
@@ -4789,6 +4799,10 @@ gfc_resolve_forall_body (gfc_code *code, int nvar, gfc_expr **var_expr)
gfc_resolve_assign_in_forall (c, nvar, var_expr);
break;
+ case EXEC_ASSIGN_CALL:
+ resolve_call (c);
+ break;
+
/* Because the gfc_resolve_blocks() will handle the nested FORALL,
there is no need to handle it here. */
case EXEC_FORALL: