Janus Weil - Re: [Patch, Fortran, F03] PR 40870: include formal args in backend_dec (original) (raw)
This is the mail archive of the fortran@gcc.gnu.orgmailing list for the GNU Fortran project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Re: [Patch, Fortran, F03] PR 40870: include formal args in backend_decl of PPCs
- From: Janus Weil
- To: Tobias Burnus
- Cc: Paul Richard Thomas , gfortran , gcc-patches
- Date: Tue, 18 Aug 2009 14:09:38 +0200
- Subject: Re: [Patch, Fortran, F03] PR 40870: include formal args in backend_decl of PPCs
- References: <854832d40908031315t50eee9a5sff87f1505aced93c@mail.gmail.com> <339c37f20908040228k538c6ec2qca9c1a2dc13c5de@mail.gmail.com> <854832d40908040502n5a0b8071kab9a5bd14bd71a3f@mail.gmail.com> <339c37f20908040543m1a36b348nee4d387287d70808@mail.gmail.com> <854832d40908040617x2bad3387q96c5a6595f55f787@mail.gmail.com> <339c37f20908040723p2b2dae7eq6b4b302c16d30e63@mail.gmail.com> <854832d40908050150u7f088d85ja82c9f05aaab5d03@mail.gmail.com> <4A8A5502.50800@net-b.de>
2009/8/18 Tobias Burnus burnus@net-b.de:
Updated patch (based on Paul's version) is attached. Ok to commit after another regtest?
It looks OK, except I stumbled over:
- ?/* Implicit interface (only return value may be known). ?*/ ? if (c->attr.function && !c->attr.dimension) [...]
- ? ?t = gfc_typenode_for_spec (&c->ts); ? else ? ? t = void_type_node;
And wondered about the "dimension" attribute. And indeed, checking for dimension is not enough as the following example shows:
You're right. I added a check for CHARACTER types now (regarding the other checks in gfc_return_by_reference: g77 compatibility is probably not so important for PPCs).
module m ?type :: t ?procedure(character(len=5)), pointer, nopass :: ptr ?end type contains ?function abc() ? character(len=5) :: abc ? abc = 'abcde' ?end function abc end module m
use m ?type(t) :: x ?character(len=5) :: str ?x%ptr => abc ?str = x%ptr() end
That crashes with:
test.f90: In function 'MAIN__': test.f90:12:0: internal compiler error: in gfc_conv_component_ref, at fortran/trans-expr.c:477
I'm afraid CHARACTER types are a bit of a stepchild in the procptr implementation. Your test case fails with the same error when using "procedure(abc), pointer, nopass :: ptr", which means that this is not directly connected to the piece of code you quoted above. Moreover, already the following fails (with a different error):
procedure(character(len=5)), pointer :: pp pp => abc contains function abc() character(len=5) :: abc abc = 'abcde' end function abc end
My suggestion would be to commit the patch as attached, and open a new PR for the CHARACTER problems. Is that ok?
Cheers, Janus
- Follow-Ups:
- Re: [Patch, Fortran, F03] PR 40870: include formal args in backend_decl of PPCs
* From: Janus Weil - Re: [Patch, Fortran, F03] PR 40870: include formal args in backend_decl of PPCs
* From: Tobias Burnus
- Re: [Patch, Fortran, F03] PR 40870: include formal args in backend_decl of PPCs
- References:
- [Patch, Fortran, F03] PR 40870: include formal args in backend_decl of PPCs
* From: Janus Weil - Re: [Patch, Fortran, F03] PR 40870: include formal args in backend_decl of PPCs
* From: Paul Richard Thomas - Re: [Patch, Fortran, F03] PR 40870: include formal args in backend_decl of PPCs
* From: Janus Weil - Re: [Patch, Fortran, F03] PR 40870: include formal args in backend_decl of PPCs
* From: Paul Richard Thomas - Re: [Patch, Fortran, F03] PR 40870: include formal args in backend_decl of PPCs
* From: Janus Weil - Re: [Patch, Fortran, F03] PR 40870: include formal args in backend_decl of PPCs
* From: Paul Richard Thomas - Re: [Patch, Fortran, F03] PR 40870: include formal args in backend_decl of PPCs
* From: Janus Weil - Re: [Patch, Fortran, F03] PR 40870: include formal args in backend_decl of PPCs
* From: Tobias Burnus
- [Patch, Fortran, F03] PR 40870: include formal args in backend_decl of PPCs
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |