https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99226
--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #3) > So, either we diagnose ... in check_omp_nesting_restrictions. See comment 4. * * * Only for completeness, the ICE is itself is due to: '.omp_data_i' showing up in 'sub' and not only in 'sub_._omp_fn.0'. This only occurs with -O1 (and higher) and -fdump-tree-omplower shows: void sub (integer(kind=4) & restrict n) { integer(kind=4) i; { D.3961 = .omp_data_i->D.3941; // <<< WRONG!!! Codewise, the '!optimize' occurs via gimplify.c's lookup_tmp_var if is_formal=true – as called by 'get_formal_tmp_var'.