https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116829
--- Comment #2 from Tomáš Trnka <trnka at scm dot com> --- I have sent a candidate fix for this to the mailing list in the past (and then somehow forgot about it): https://gcc.gnu.org/pipermail/fortran/2024-September/061086.html