Re: The root cause for SEGV in evaluating fortran function call, any solution or suggestion?

Jim Blandy
2005-11-03T07:42:55Z

Mark Kettenis <mark.kettenis@xs4all.nl> writes:
> One could argue that the debug information generated by g77 is wrong,
> because it doesn't reflect the actual implementation of FUNC_NAME. Or
> perhaps GDB symbol reading code causes problems. Can you post a
> concrete example of a function call that goes wrong, and add a bit of
> explanation about the types involved for those of us who are not very
> familiar with Fortran?

The types in the debug information should not reflect the extra level
of indirection; the fact that they're passed by reference is just part
of the meaning of a Fortran function call. But the location
expression should encode the extra level of indirection.

Probably value_arg_coerce should be a language method. The C
promotion rules aren't appropriate for Fortran anyway, and the Fortran
version could take care of applying value_addr (or something like
that), and turning the array of actuals into an array of pointers to
the actuals.