https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66605
--- Comment #7 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- (In reply to Dominique d'Humieres from comment #5) > If I understand correctly the above statement, -Wunused-parameter should not > emit a warning for the test in comment 0: there is no parameter. The warning > should be issued with -Wunused-dummy-argument If so, then the ICE was not caused by my diagnostic changes, it just exposes a problem that has been latent or introduced later. Thus, I'm not planning to investigate further. If it is possible to generate a valid warning that triggers the same ICE, then we should consider one of the options I have proposed above. From your explanation above, it seems likely that Fortran doesn't ever want to get the middle-end warning (which makes me wonder why this warning is given in the middle-end to begin with!). Thus another (ugly?) fix may be to disable the warning (all warnings?) completely around calls to finalize_function.