This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran] PRs 60495/58880: Fix issues with finalization expressions
- From: Mikael Morin <mikael dot morin at sfr dot fr>
- To: Tobias Burnus <burnus at net-b dot de>, Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Sun, 06 Apr 2014 22:59:48 +0200
- Subject: Re: [Patch, Fortran] PRs 60495/58880: Fix issues with finalization expressions
- Authentication-results: sourceware.org; auth=none
- References: <533F2F37 dot 8010304 at net-b dot de> <20140405211236 dot GA10342 at nbbrfq dot cc dot univie dot ac dot at> <53417B2E dot 8000608 at net-b dot de> <5341826D dot 8090208 at sfr dot fr> <53419300 dot 7090609 at net-b dot de> <534197A3 dot 6010400 at sfr dot fr> <53419D4B dot 6000607 at net-b dot de>
Le 06/04/2014 20:30, Tobias Burnus a écrit :
> Mikael Morin wrote:
>> Argh. great. What about the use_assoc thing? Why is that needed?
>
> Frankly, I don't know. In terms of the code, the problem is that
> attr.use_assoc is zero and, hence, the compiler generates a call to some
> external version which lacks the module name - that symbol is not found
> and, unsurprisingly, there is a link-time failure (symbol reference not
> found).
>
> However, I have a completely untested hypothesis: The derived type is
> use associated (fact) when following sym->ts.u.derived to the vtab and
> then further to vtab->_final one at some point does no longer access a
> use associated variable but the one of the module. As it is used in the
> module, it is not use associated and lacks that attribute. In that sense
> it is wrong to set it in trans.c as my patch does. However, that section
> of the code is only reached after the module generation has finished.
> Hence, it is should be safe to modify the attribute. (If it had been
> generated in the module, final_expr->...->sym->backend_decl would be set
> and we could use it directly.)
>
Unless I have messed up something on my side, the testcase seems to work
here without the use_assoc change; could you double-check? The patch is
ok if it works (without the trans.c part of course).
Mikael