[gfortran] Cleanup handling of sym vs. sym->result was: Re: [Patch/gfortran] Fix for PR16939
Tobias Schlüter
tobias.schlueter@physik.uni-muenchen.de
Wed May 11 17:22:00 GMT 2005
Tobias Schlüter wrote:
> [ my original reply didn't make it to the list ]
>
> THOMAS Paul Richard 169137 wrote:
>
>>>Oh, and I'm wondering if I should have added
>>>
>>>>!sym->attr.pointer to that
>>
>>
>>I think that your next remark is right.
>
>
> I'll look into this later today.
This is fixed in the attached patch together with a number of other cleanups,
made possible by my previous patch. The combination of both implements what I
was saying here:
> Bleh, we need to make sure that every function has sym->result's properties
> set consistently with sym's properties. That way we could do away with a lot
> of special cases. There is code for this in resolve_formal_arglist but it
> doesn't handle everything, because all those special cases that are scattered
> around the code generation passes wouldn't be necessary then.
The necessary change to resolve.c was in the previous patch. What is below is
the ensuing cleanup. I also attached two more testcases which verify that
-ff2c works reliably. I would have liked to test these testcases with both
-ff2c and -fno-f2c but I couldn't find a way of making the testsuite do this
without duplicating the testcases, so I left that to someone doing future work
on the testsuite.
Bubblestrapped and regtested, ok?
- Tobi
2005-05-11 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* trans-expr.c (gfc_conv_variable): POINTER results don't need f2c
calling conventions. Look at sym instead of sym->result.
* trans-types.c (gfc_sym_type): Remove workaround for frontend bug.
Remove condition which is always false with workaround removed.
(gfc_return_by_reference): Always look at sym, never at sym->result.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: followup.diff
Type: text/x-patch
Size: 2885 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050511/ddfbe264/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: f2c_4.f90
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050511/ddfbe264/attachment.f90>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: f2c_5.f90
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050511/ddfbe264/attachment-0001.f90>
More information about the Fortran
mailing list