This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, fortran] PR44265 - Link error with reference to parameter array in specification expression
- From: Dominique d'Humières <dominiq at lps dot ens dot fr>
- To: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Ian Harvey <ian_harvey at bigpond dot com>
- Date: Wed, 7 Dec 2016 20:11:04 +0100
- Subject: Re: [Patch, fortran] PR44265 - Link error with reference to parameter array in specification expression
- Authentication-results: sourceware.org; auth=none
- References: <CAGkQGiKhuq2Pw0T8URCD3ZiA-hDpmXZZr4kJvg8PZQdCoORSWw@mail.gmail.com> <8599BDBA-59DD-4798-B704-E28DC89206E2@lps.ens.fr> <CAGkQGiJrm2r0uRpe9eLBn+yQrC0zfy+oxoriy0GDPU07GJ=iug@mail.gmail.com> <35277185-71C2-4038-8042-548E94435E15@lps.ens.fr> <CAGkQGiLxpkymr-+pXK-aie9gFhe3OKROf1sfsEawQzUP9Ex+uQ@mail.gmail.com> <DEF70D26-CBA0-4485-9929-E872E87F1938@lps.ens.fr> <5E1A2C1A-71C2-493C-A142-9FB74E2F43E3@lps.ens.fr> <CAGkQGiKmnhdj+aorkhLSik==MqA5iKs-2hFWWpp8NovwhXs6GQ@mail.gmail.com>
The tests gfortran.dg/char_result_16.f90 and gfortran.dg/char_result_17.f90 fail with
lto1: error: two or more sections for .gnu.lto___get_PROC_names.3e3ee55b08747e7c
lto1: internal compiler error: cannot read LTO decls from /var/folders/8q/sh_swgz96r7f5vnn08f7fxr00000gn/T//ccEJosbA.o
This may be darwin specific as the linker is more picky than the linux one.
Dominique
> Le 7 déc. 2016 à 16:47, Paul Richard Thomas <paul.richard.thomas@gmail.com> a écrit :
>
> Dear Dominique,
>
> I will turn to the effect on PR77414 after committing the patch for PR44265.
>
> The attached fixes the -flto problem. The chunk in
> trans-decl.c(gfc_finish_var_decl) did the job. It is quite obvious now
> and, in fact, I am a bit surprised that the patch worked at all
> without the DECL_EXTERNAL.
>
> Bootstraps and regtests on FC21/x86_64 - OK for trunk?
>
> Paul
>
> 2016-12-07 Paul Thomas <pault@gcc.gnu.org>
>
> PR fortran/44265
> * gfortran.h : Add fn_result_spec bitfield to gfc_symbol.
> * resolve.c (flag_fn_result_spec): New function.
> (resolve_fntype): Call it for character result lengths.
> * symbol.c (gfc_new_symbol): Set fn_result_spec to zero.
> * trans-decl.c (gfc_sym_mangled_identifier): Include the
> procedure name in the mangled name for symbols with the
> fn_result_spec bit set.
> (gfc_finish_var_decl): Mark the decls of these symbols
> appropriately for the case where the function is external.
> (gfc_get_symbol_decl): Mangle the name of these symbols.
> (gfc_create_module_variable): Allow them through the assert.
> (gfc_generate_function_code): Remove the assert before the
> initialization of sym->tlink because the frontend no longer
> uses this field.
> * trans-expr.c (gfc_map_intrinsic_function): Add a case to
> treat the LEN_TRIM intrinsic.
>
> 2016-12-07 Paul Thomas <pault@gcc.gnu.org>
>
> PR fortran/44265
> * gfortran.dg/char_result_14.f90: New test.
> * gfortran.dg/char_result_15.f90: New test.
> * gfortran.dg/char_result_16.f90: New test.
> * gfortran.dg/char_result_17.f90: New test.
>
>