https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87043
Dominique d'Humieres <dominiq at lps dot ens.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING Last reconfirmed| |2018-10-25 Ever confirmed|0 |1 --- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- > Not sure if > > allocate(error_messages(world_size), stat=allocstat) > max_err_len = maxval(len_trim(error_messages)) > > is well-defined fortran iff allocation fails? I suppose not, so > warning is correct, testcase is broken? There is no warning if I replace if (world_rank == 0) then with if (world_rank == 0 .and. allocstat == 0) then > Oh, I see your point. But then still the question is why this warning > is not shown when compiling with -Og. Why do you expect middle-end warnings to be independent of the optimization level? In any case, if this PR is not closed, its component should be moved to middle-end.