diff options
| author | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-29 20:38:59 +0000 |
|---|---|---|
| committer | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-29 20:38:59 +0000 |
| commit | 8d60cc468e8c1956cef570588d4297ce3a740328 (patch) | |
| tree | aca49e7453dd7b8e481ea5b320d8145f0bddc97c /gcc/fortran/trans-expr.c | |
| parent | e0ca1cb51d9b2ab809ab53276a9922bc90b892b1 (diff) | |
| download | ppe42-gcc-8d60cc468e8c1956cef570588d4297ce3a740328.tar.gz ppe42-gcc-8d60cc468e8c1956cef570588d4297ce3a740328.zip | |
2009-06-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/40551
* dependency.h : Add second bool* argument to prototype of
gfc_full_array_ref_p.
* dependency.c (gfc_full_array_ref_p): If second argument is
present, return true if last dimension of reference is an
element or has unity stride.
* trans-array.c : Add NULL second argument to references to
gfc_full_array_ref_p.
* trans-expr.c : The same, except for;
(gfc_trans_arrayfunc_assign): Return fail if lhs reference
is not a full array or a contiguous section.
2009-06-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/40551
* gfortran.dg/func_assign_2.f90 : New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149062 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-expr.c')
| -rw-r--r-- | gcc/fortran/trans-expr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index f79ad4b3cc7..6a38f10f656 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -4300,6 +4300,7 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2) gfc_ss *ss; gfc_ref * ref; bool seen_array_ref; + bool c = false; gfc_component *comp = NULL; /* The caller has already checked rank>0 and expr_type == EXPR_FUNCTION. */ @@ -4311,6 +4312,10 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2) && expr2->value.function.esym->attr.elemental) return NULL; + /* Fail if rhs is not FULL or a contiguous section. */ + if (expr1->ref && !(gfc_full_array_ref_p (expr1->ref, &c) || c)) + return NULL; + /* Fail if EXPR1 can't be expressed as a descriptor. */ if (gfc_ref_needs_temporary_p (expr1->ref)) return NULL; @@ -4785,7 +4790,7 @@ copyable_array_p (gfc_expr * expr) if (expr->rank < 1 || !expr->ref || expr->ref->next) return false; - if (!gfc_full_array_ref_p (expr->ref)) + if (!gfc_full_array_ref_p (expr->ref, NULL)) return false; /* Next check that it's of a simple enough type. */ |

