Commit 5af2eace by Paul Thomas

[multiple changes]

2009-07-22  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/40796
	* trans-decl.c (generate_local_decl): Unreferenced result
	variables with allocatable components should be treated like
	INTENT_OUT dummy variables.

2009-07-21  Richard Guenther  <rguenther@suse.de>

	PR fortran/40726
	Change attribution to Richi.

From-SVN: r149952
parent 61ed6392
2009-07-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/40796
* trans-decl.c (generate_local_decl): Unreferenced result
variables with allocatable components should be treated like
INTENT_OUT dummy variables.
2009-07-22 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> 2009-07-22 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* trans.h (gfc_set_decl_assembler_name): New prototype. * trans.h (gfc_set_decl_assembler_name): New prototype.
...@@ -8,7 +15,7 @@ ...@@ -8,7 +15,7 @@
* trans-common.c (build_common_decl): Use * trans-common.c (build_common_decl): Use
gfc_set_decl_assembler_name instead of SET_DECL_ASSEMBLER_NAME. gfc_set_decl_assembler_name instead of SET_DECL_ASSEMBLER_NAME.
2009-07-21 Paul Thomas <pault@gcc.gnu.org> 2009-07-21 Richard Guenther <rguenther@suse.de>
PR fortran/40726 PR fortran/40726
* trans-decl.c (gfc_get_extern_function_decl): Do not set * trans-decl.c (gfc_get_extern_function_decl): Do not set
......
...@@ -3702,19 +3702,20 @@ generate_local_decl (gfc_symbol * sym) ...@@ -3702,19 +3702,20 @@ generate_local_decl (gfc_symbol * sym)
gfc_get_symbol_decl (sym); gfc_get_symbol_decl (sym);
} }
/* INTENT(out) dummy arguments with allocatable components are reset /* INTENT(out) dummy arguments and result variables with allocatable
by default and need to be set referenced to generate the code for components are reset by default and need to be set referenced to
automatic lengths. */ generate the code for nullification and automatic lengths. */
if (sym->attr.dummy && !sym->attr.referenced if (!sym->attr.referenced
&& sym->ts.type == BT_DERIVED && sym->ts.type == BT_DERIVED
&& sym->ts.derived->attr.alloc_comp && sym->ts.derived->attr.alloc_comp
&& sym->attr.intent == INTENT_OUT) && ((sym->attr.dummy && sym->attr.intent == INTENT_OUT)
||
(sym->attr.result && sym != sym->result)))
{ {
sym->attr.referenced = 1; sym->attr.referenced = 1;
gfc_get_symbol_decl (sym); gfc_get_symbol_decl (sym);
} }
/* Check for dependencies in the array specification and string /* Check for dependencies in the array specification and string
length, adding the necessary declarations to the function. We length, adding the necessary declarations to the function. We
mark the symbol now, as well as in traverse_ns, to prevent mark the symbol now, as well as in traverse_ns, to prevent
......
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