Hello, I stumbled upon https://lwn.net/Articles/1070185/ telling about the untimely passing of Tomáš Kalibera. My condolences to his family and friends.
Tomáš was a R core developer, and he interacted with the GFortran community back in 2019 when he discovered and did the initial debugging of a nasty ABI issue wrt to C code omitting the hidden string length argument when calling Fortran procedures with single-character string arguments. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90329 for details. Taking this opportunity to look back at the issue, the good news is that after figuring out there was nothing that GFortran could do to special case the ABI of procedures with character(len=1) arguments without breaking other standard-conforming code, a workaround was found which disables the problematic optimization. This option, -ftail-call-workaround, defaults to -ftail-call-workaround=1 which disables it for procedures with character arguments and calling other procedures with implicit interfaces, at rather minimal performance impact. The bad news, quickly looking at the linked github issues, while some high-profile projects like LAPACK were fixed, as the workaround was quickly deployed to all active GFortran branches at the time, I suspect there's still boatloads of other projects out there misusing the calling conventions, blissfully unaware of the danger lurking below the surface. So despite the Gfortran manual still warning about the default for -ftail-call-workaround changing in future releases, I don't really see any prospect for doing that in the foreseeable future. -- Janne Blomqvist
