https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120099
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|ipa |fortran --- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I think this is a front-end issue with gfortran_f2c functions: ``` /* Set attributes for PURE functions. A call to PURE function in the Fortran 95 sense is both pure and without side effects in the C sense. */ if (sym->attr.pure || sym->attr.implicit_pure) { if (sym->attr.function && !gfc_return_by_reference (sym)) DECL_PURE_P (fndecl) = 1; /* TODO: check if pure SUBROUTINEs don't have INTENT(OUT) parameters and don't use alternate returns (is this allowed?). In that case, calls to them are meaningless, and can be optimized away. See also in build_function_decl(). */ TREE_SIDE_EFFECTS (fndecl) = 0; } ``` Can't be done for the f2c functions.