[Bug fortran/118080] OPTIONAL, VALUE mishandled: type(c_ptr) – hidden argument missing, ICE with derived type

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 17 18:24:48 GMT 2024


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118080

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
> CLASS and DT were excepted because IMO there is no clear existing definition
how to handle these.

Then there should be a compile-time error ("SORRY").

Fortran (the spec) is quite open in terms of how it is implemented. If a
derived type (w/o allocatable components) is just passed via the stack (=
platform ABI), it will automatically create a copy, otherwise, we could
implement it by copying it (either in the caller or callee; the latter might
provide more room for optimizations in general, unless we already do copy in on
the caller side, then it's better on the caller side).

In any case, just silently failing is not really an option …


More information about the Gcc-bugs mailing list