lang.opt, [...]: New flag -finit-derived.
authorFritz Reese <fritzoreese@gmail.com>
Mon, 15 Aug 2016 21:19:09 +0000 (21:19 +0000)
committerFritz Reese <foreese@gcc.gnu.org>
Mon, 15 Aug 2016 21:19:09 +0000 (21:19 +0000)
commit7fc61626174d8fa80e2af1ff693b7075da4cf039
treefdbf0c01463438b4e88470ff54f74cbb32cfe8b7
parent874be74ab3d68a57e7938900e9e1364b8101ade9
lang.opt, [...]: New flag -finit-derived.

2016-08-15  Fritz Reese  <fritzoreese@gmail.com>

gcc/fortran/
* lang.opt, invoke.texi: New flag -finit-derived.
* gfortran.h (gfc_build_default_init_expr, gfc_apply_init,
gfc_generate_initializer): New prototypes.
* expr.c (gfc_build_default_init_expr, gfc_apply_init,
component_initializer, gfc_generate_initializer): New functions.
* expr.c (gfc_default_initializer): Wrap gfc_generate_initializer.
* decl.c (build_struct): Move common code to gfc_apply_init.
* resolve.c (can_generate_init): New function.
* resolve.c (build_default_init_expr): Wrap gfc_build_default_init_expr.
* resolve.c (apply_default_init, resolve_fl_variable_derived): Use
gfc_generate_initializer.
* trans-decl.c (gfc_generate_function_code): Use
gfc_generate_initializer.

gcc/testsuite/gfortran.dg/
* init_flag_13.f90: New testcase.
* init_flag_14.f90: Ditto.
* init_flag_15.f03: Ditto.
* dec_init_1.f90: Ditto.
* dec_init_2.f90: Ditto.

From-SVN: r239489
14 files changed:
gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/fortran/expr.c
gcc/fortran/gfortran.h
gcc/fortran/invoke.texi
gcc/fortran/lang.opt
gcc/fortran/resolve.c
gcc/fortran/trans-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/dec_init_1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/dec_init_2.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/init_flag_13.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/init_flag_14.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/init_flag_15.f03 [new file with mode: 0644]