summaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-stmt.c
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-27 20:47:55 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-27 20:47:55 +0000
commit1acb400aeb05e3c54d9d336e10ed23b81636d4b6 (patch)
tree02fd93e8d327aa79aa562c5f974746f1257b83be /gcc/fortran/trans-stmt.c
parent2168078b6c20284948b33995075b4d6c70fb3903 (diff)
downloadgcc-1acb400aeb05e3c54d9d336e10ed23b81636d4b6.tar.gz
2007-11-27 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29389 *resolve.c (resolve_ordinary_assign): Use find_sym_in_expr to test if a temporary should be written for a vector subscript on the lhs. PR fortran/33850 * restore.c (pure_stmt_function): Add prototype and new function. Calls impure_stmt_fcn. (pure_function): Call it. (impure_stmt_fcn): New function. * expr.c (gfc_traverse_expr): Call *func for all expression types, not just variables. Add traversal of character lengths, iterators and component character lengths and arrayspecs. (expr_set_symbols_referenced): Return false if not a variable. * trans-stmt.c (forall_replace, forall_restore): Ditto. * resolve.c (forall_index): Ditto. (sym_in_expr): New function. (find_sym_in_expr): Rewrite to traverse expression calling sym_in_expr. *trans-decl.c (expr_decls): New function. (generate_expr_decls): Rewrite to traverse expression calling expr_decls. *match.c (check_stmt_fcn): New function. (recursive_stmt_fcn): Rewrite to traverse expression calling check_stmt_fcn. 2007-11-27 Paul Thomas <pault@gcc.gnu.org> PR fortran/29389 * gfortran.dg/stfunc_6.f90: New test. PR fortran/33850 * gfortran.dg/assign_10.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130472 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-stmt.c')
-rw-r--r--gcc/fortran/trans-stmt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index ee176dcb75d..c8343f3971b 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -1523,7 +1523,8 @@ static gfc_symtree *old_symtree;
static bool
forall_replace (gfc_expr *expr, gfc_symbol *sym, int *f)
{
- gcc_assert (expr->expr_type == EXPR_VARIABLE);
+ if (expr->expr_type != EXPR_VARIABLE)
+ return false;
if (*f == 2)
*f = 1;
@@ -1544,7 +1545,8 @@ forall_restore (gfc_expr *expr,
gfc_symbol *sym ATTRIBUTE_UNUSED,
int *f ATTRIBUTE_UNUSED)
{
- gcc_assert (expr->expr_type == EXPR_VARIABLE);
+ if (expr->expr_type != EXPR_VARIABLE)
+ return false;
if (expr->symtree == new_symtree)
expr->symtree = old_symtree;