Fix -finit-derived for c_ptr and c_funptr in programs which use
commitd66a58d333eadd07eeb3e86bb8fc06a4ee3158bf
authorFritz Reese <fritzoreese@gmail.com>
Mon, 25 Jun 2018 18:33:11 +0000 (25 18:33 +0000)
committerFritz Reese <foreese@gcc.gnu.org>
Mon, 25 Jun 2018 18:33:11 +0000 (25 18:33 +0000)
treea9ceb2d95c61470764b8b3df11ffc22f6d358567
parent21925ac173495dad58a5ed0293ceb0203f849a51
Fix -finit-derived for c_ptr and c_funptr in programs which use
    iso_c_binding.

    gcc/fortran/ChangeLog:

    2018-06-25  Fritz Reese  <fritzoreese@gmail.com>

PR fortran/82972
        PR fortran/83088
        PR fortran/85851
* expr.c (component_initializer): Assign init expr to c->initializer.
(generate_isocbinding_initializer): New.
(gfc_generate_initializer): Call generate_isocbinding_initializer to
generate initializers for c_ptr and c_funptr with -finit-derived.

    gcc/testsuite/ChangeLog:

    2018-06-25  Fritz Reese  <fritzoreese@gmail.com>

PR fortran/82972
        PR fortran/83088
        PR fortran/85851
* gfortran.dg/init_flag_17.f90: New testcase.

From-SVN: r262104
gcc/fortran/ChangeLog
gcc/fortran/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/init_flag_17.f90 [new file with mode: 0644]