re PR fortran/35780 (internal compiler error for complicated PARAMETER expressions)

2008-12-22  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/35780
	* trans-decl.c (init_intent_out_dt): Allow for optional args.

From-SVN: r142889
This commit is contained in:
Paul Thomas 2008-12-22 23:11:29 +00:00 committed by Jerry DeLisle
parent 5d88d3be0a
commit 8a2725318b
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2008-12-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35780
* trans-decl.c (init_intent_out_dt): Allow for optional args.
2008-12-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/38398

View File

@ -2791,6 +2791,7 @@ init_intent_out_dt (gfc_symbol * proc_sym, tree body)
stmtblock_t fnblock;
gfc_formal_arglist *f;
tree tmp;
tree present;
gfc_init_block (&fnblock);
for (f = proc_sym->formal; f; f = f->next)
@ -2802,6 +2803,11 @@ init_intent_out_dt (gfc_symbol * proc_sym, tree body)
tmp = gfc_deallocate_alloc_comp (f->sym->ts.derived,
f->sym->backend_decl,
f->sym->as ? f->sym->as->rank : 0);
present = gfc_conv_expr_present (f->sym);
tmp = build3 (COND_EXPR, TREE_TYPE (tmp), present,
tmp, build_empty_stmt ());
gfc_add_expr_to_block (&fnblock, tmp);
}