This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch/gfortran] Fix for PR16939
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: THOMAS Paul Richard 169137 <prthomas at drfccad dot cea dot fr>
- Cc: "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>
- Date: Wed, 11 May 2005 12:57:14 +0200
- Subject: Re: [Patch/gfortran] Fix for PR16939
- References: <756DFD3DE8F1D411A59A00306E06E84702C426F9@drfccad.cad.cea.fr>
[ 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.
> The reason that my patches appeared to be broken is that something nasty
> happened to the test cases, in a place that I do not think I have touched
> (attr.function and attr.result now behave differently).
>
> This fails with a seg fault:
>
> program testch
> print *, ch()
> contains
> function ch result(str)
> character(len = 10),pointer :: str
> str ="hello"
> end function ch
> end program testch
>
> This works:
>
> program testch
> print *, ch()
> contains
> function ch
> character(len = 10) :: ch
> ch ="hello"
> end function ch
> end program testch
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.
I remember changing sym vs. sym->result in a few places (sorry, it's been two
months since I wroter the f2c patch, and I only briefly scanned through it for
completeness yesterday). I mostly trying to make this stuff more consistent,
but it could be that it interferes with some character stuff, where
inconsistencies may have been the other way round or some similar nastiness.
- Tobi