https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87919
Bug ID: 87919 Summary: Incorrect fortran handling of -fno-* options Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org Target Milestone: --- Seems gfc_handle_options doesn't handle properly some -fno-* options. Mark Eggleston has a fix for -fno-dec-structure (that acts the same as -fdec-structure), but -fno-check-array-temporaries, -fno-init-local-zero and -fno-dec behave similarly, they ignore the no- part completely. In case OPT_fcheck_array_temporaries: gfc_option.rtcheck |= GFC_RTCHECK_ARRAY_TEMPS; break; I guess it should be: if (value) gfc_option.rtcheck |= GFC_RTCHECK_ARRAY_TEMPS; else gfc_option.rtcheck &= ~GFC_RTCHECK_ARRAY_TEMPS; for -fno-initi-local-zero for !value I'd say it should set all the knobs to *_OFF, and -fno-dec, the question is if set_dec_flags (0) actually shouldn't also undo what set_dec_flags (1) does; then it should do the &= ~ for !value rather than the useless |= value; which does nothing if value is 0.