http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57306
--- Comment #9 from janus at gcc dot gnu.org --- (In reply to janus from comment #8) > Giving 'x' the SAVE attribute makes both versions compile without error. I > guess the original version is still valid, since 'x' should implicitly get > the SAVE attribute [1]. However, without the explicit SAVE declaration, it > is not shown as 'static' in the dump. Problem is: We currently don't make variables in the main program SAVE_IMPLICT yet. There is a patch in PR 55207 comment 3 which does this. Applying it (in addition to the patch from comment 6) makes the ICE in comment 7 go away. Unfortunately it had a couple of regressions, see in particular PR 55207 comment 6.