Commit 55ed891f by Paul Thomas

re PR fortran/32903 (Default initializer and intent(OUT): default initializer not used)

2007-07-27  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/32903
	* trans-decl.c (gfc_trans_deferred_vars): Set intent(out)
	derived types as referenced, if they have the the default
	initializer set.

From-SVN: r126974
parent d426d208
2007-07-27 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32903
* trans-decl.c (gfc_trans_deferred_vars): Set intent(out)
derived types as referenced, if they have the the default
initializer set.
2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gfortran.h (generate_isocbinding_symbol): Constify.
* symbol.c (gen_special_c_interop_ptr, gen_cptr_param,
generate_isocbinding_symbol): Likewise.
2007-07-24 Paul Thomas <pault@gcc.gnu.org>
2007-07-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/31205
PR fortran/32842
......
......@@ -2735,8 +2735,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
/* If an INTENT(OUT) dummy of derived type has a default
initializer, it must be initialized here. */
if (f->sym && f->sym->attr.referenced
&& f->sym->attr.intent == INTENT_OUT
if (f->sym && f->sym->attr.intent == INTENT_OUT
&& f->sym->ts.type == BT_DERIVED
&& !f->sym->ts.derived->attr.alloc_comp
&& f->sym->value)
......@@ -2744,6 +2743,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
gfc_expr *tmpe;
tree tmp, present;
gcc_assert (!f->sym->attr.allocatable);
gfc_set_sym_referenced (f->sym);
tmpe = gfc_lval_expr_from_sym (f->sym);
tmp = gfc_trans_assignment (tmpe, f->sym->value, false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment