diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2010-07-10 14:57:25 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2010-07-10 14:57:25 +0000 |
commit | 022e30c0b67a70587b22fc67f7a7e11e0600005f (patch) | |
tree | 80d52358390417552d8db01d6fc4df580bda732c /gcc/fortran/resolve.c | |
parent | ccf134c74c7d1bc0511fdc648c9996164c44437d (diff) | |
download | gcc-022e30c0b67a70587b22fc67f7a7e11e0600005f.zip gcc-022e30c0b67a70587b22fc67f7a7e11e0600005f.tar.gz gcc-022e30c0b67a70587b22fc67f7a7e11e0600005f.tar.bz2 |
re PR fortran/44773 (Unnecessary temporaries increase the runtime for channel.f90 by ~70%)
2010-07-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/44773
* trans-expr.c (arrayfunc_assign_needs_temporary): No temporary
if the lhs has never been host associated, as well as not being
use associated, a pointer or a target.
* resolve.c (resolve_variable): Mark variables that are host
associated.
* gfortran.h: Add the host_assoc bit to the symbol_attribute
structure.
From-SVN: r162038
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index a8ed544..98d1e07 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -4772,6 +4772,15 @@ resolve_variable (gfc_expr *e) sym->entry_id = current_entry_id + 1; } + /* If a symbol has been host_associated mark it. This is used latter, + to identify if aliasing is possible via host association. */ + if (sym->attr.flavor == FL_VARIABLE + && gfc_current_ns->parent + && (gfc_current_ns->parent == sym->ns + || (gfc_current_ns->parent->parent + && gfc_current_ns->parent->parent == sym->ns))) + sym->attr.host_assoc = 1; + resolve_procedure: if (t == SUCCESS && resolve_procedure_expression (e) == FAILURE) t = FAILURE; |