https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105012

--- Comment #34 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Mikael Morin
<mik...@gcc.gnu.org>:

https://gcc.gnu.org/g:e34e5195025acd623c2383c36b99cc88ca026acf

commit r11-10299-ge34e5195025acd623c2383c36b99cc88ca026acf
Author: Mikael Morin <mik...@gcc.gnu.org>
Date:   Mon Aug 29 11:19:29 2022 +0200

    fortran: Fix invalid function decl clobber ICE [PR105012]

    The fortran frontend, as result symbol for a function without
    declared result symbol, uses the function symbol itself.  This caused
    an invalid clobber of a function decl to be emitted, leading to an
    ICE, whereas the intended behaviour was to clobber the function result
    variable.  This change fixes the problem by getting the decl from the
    just-retrieved variable reference after the call to
    gfc_conv_expr_reference, instead of copying it from the frontend symbol.

            PR fortran/105012

    gcc/fortran/ChangeLog:

            * trans-expr.c (gfc_conv_procedure_call): Retrieve variable
            from the just calculated variable reference.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/intent_out_15.f90: New test.

    (cherry picked from commit edaf1e005c90b311c39b46d85cea17befbece112)

Reply via email to