This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/29216] Derived type components of function results are not initialised
- From: "pault at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Oct 2006 04:51:29 -0000
- Subject: [Bug fortran/29216] Derived type components of function results are not initialised
- References: <bug-29216-13292@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #10 from pault at gcc dot gnu dot org 2006-10-19 04:51 -------
Subject: Bug 29216
Author: pault
Date: Thu Oct 19 04:51:14 2006
New Revision: 117879
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117879
Log:
2006-10-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29216
PR fortran/29314
* gfortran.h : Add EXEC_INIT_ASSIGN.
* dump-parse-tree.c (gfc_show_code_node): The same.
* trans-openmp.c (gfc_trans_omp_array_reduction): Set new
argument for gfc_trans_assignment to false.
* trans-stmt.c (gfc_trans_forall_1): The same.
* trans-expr.c (gfc_conv_function_call, gfc_trans_assign,
gfc_trans_arrayfunc_assign, gfc_trans_assignment): The
same. In the latter function, use the new flag to stop
the checking of the lhs for deallocation.
(gfc_trans_init_assign): New function.
* trans-stmt.h : Add prototype for gfc_trans_init_assign.
* trans.c (gfc_trans_code): Implement EXEC_INIT_ASSIGN.
* trans.h : Add new boolean argument to the prototype of
gfc_trans_assignment.
* resolve.c (resolve_allocate_exp): Replace EXEC_ASSIGN by
EXEC_INIT_ASSIGN.
(resolve_code): EXEC_INIT_ASSIGN does not need resolution.
(apply_default_init): New function.
(resolve_symbol): Call it for derived types that become
defined but which do not already have an initialization
expression..
* st.c (gfc_free_statement): Include EXEC_INIT_ASSIGN.
2006-10-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29216
* gfortran.dg/result_default_init_1.f90: New test.
PR fortran/29314
* gfortran.dg/automatic_default_init_1.f90: New test.
* gfortran.dg/alloc_comp_basics_1.f90: Reduce deallocate count
from 38 to 33.
Added:
trunk/gcc/testsuite/gfortran.dg/automatic_default_init_1.f90
trunk/gcc/testsuite/gfortran.dg/result_default_init_1.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/dump-parse-tree.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/resolve.c
trunk/gcc/fortran/st.c
trunk/gcc/fortran/trans-expr.c
trunk/gcc/fortran/trans-openmp.c
trunk/gcc/fortran/trans-stmt.c
trunk/gcc/fortran/trans-stmt.h
trunk/gcc/fortran/trans.c
trunk/gcc/fortran/trans.h
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/alloc_comp_basics_1.f90
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29216