https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100651
--- Comment #5 from Matt Thompson <matthew.thompson at nasa dot gov> --- Iain, The Linux system would be SUSE Linux Enterprise Server 12 SP3. The macOS system is macOS 11.5.1. On the Linux machine, I can confirm the error with (I only have some versions of GCC available): * 8.3.0 * 9.2.0 * 10.1.0 * 11.1.0 On the macOS where I just built 11.2.0, I see the same crash. Now, with 7.4.0 and 6.5.0 (can only test on Linux), I don't get the run-time crash. Instead, I believe it works...sort of? To wit: $ ./a.out opt_string.F90 122 T opt_string.F90 123 10922 err_msg: foo bar, err_msg: foo bar, err_msg: foo bar, err_msg: foo bar, err_msg: foo bar, err_msg: foo bar, err_msg: foo bar, err_msg: foo bar, err_msg: foo bar, err_msg: foo bar, err_msg: foo bar, err_msg: foo bar, err_msg: foo bar, err_msg: foo bar, err_msg: foo bar, err_msg: foo bar, err_msg: foo bar,... That last bit goes on for a while. This isn't the intended behavior. Intel 2021.3 does: $ ./a.out opt_string.F90 122 T opt_string.F90 123 7 err_msg: foo bar and NAG 7.0_7048 does: $ ./a.out opt_string.F90 122 T opt_string.F90 123 7 err_msg: foo bar We are unsure why GNU is doing this...recursive-like behavior? It's not like the routine is called in a loop!