[Bug fortran/78757] [7 Regression] ICE with function returning a pointer to a character

jb at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Dec 21 09:42:00 GMT 2016


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

--- Comment #8 from Janne Blomqvist <jb at gcc dot gnu.org> ---
Author: jb
Date: Wed Dec 21 09:41:25 2016
New Revision: 243842

URL: https://gcc.gnu.org/viewcvs?rev=243842&root=gcc&view=rev
Log:
PR 78867 Function returning string ICE with -flto

The fix for PR 78757 was slightly too cautious, and covered only the
case of functions returning pointers to characters. By moving the
block above the if statement the DECL_EXPR is created also for
functions returning non-pointer characters.

Regtested on x86_64-pc-linux-gnu.

fortran ChangeLog:

2016-12-21  Janne Blomqvist  <jb@gcc.gnu.org>

        PR fortran/78867
        * trans-expr.c (gfc_conv_procedure_call): Emit DECL_EXPR also for
        non-pointer character results.

testsuite ChangeLog:

2016-12-21  Janne Blomqvist  <jb@gcc.gnu.org>

        PR fortran/78867
        * gfortran.dg/string_length_4.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/string_length_4.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/testsuite/ChangeLog


More information about the Gcc-bugs mailing list