http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51218
Thomas Koenig <tkoenig at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pault at gcc dot gnu.org --- Comment #7 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-11-19 09:08:37 UTC --- A few comments: a) The call to delete_storage makes the code invalid in several respects b) This function should not have been inlined (i.e. the bug not exposed) without the -faggressive-function-elimination flag. c) The reason why this function call was inlined was that the implicit_pure attribute is set on the function. This is bogus. /* Only eliminate potentially impure functions if the user specifically requested it. */ if (!gfc_option.flag_aggressive_function_elimination && !(*e)->value.function.esym->attr.pure && !(*e)->value.function.esym->attr.implicit_pure) return 0; (gdb) p (*e)->value.function.esym->attr.pure $8 = 0 (gdb) p (*e)->value.function.esym->attr.implicit_pure $9 = 1 Paul, I think you introduced the implicit_pure attribute. Do you have any idea why this could be set in this case?