http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54553
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2012-09-12 Ever Confirmed|0 |1 --- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-12 09:33:25 UTC --- Confirmed (I think we have a dup for this). -O0 (and switching opts) sets flag_no_inline: if (opts->x_optimize == 0) { /* Inlining does not work if not optimizing, so force it not to be done. */ opts->x_warn_inline = 0; opts->x_flag_no_inline = 1; } but restoring options does not restore this flag because it is not among the options handled by cl_optimization_save/restore - it's not an "Optimization" option: ; General flag to enable inlining. Specifying -fno-inline will disable ; all inlining apart from always-inline functions. finline Common Report Var(flag_no_inline,0) Init(0) Enable inlining of function declared \"inline\", disabling disables all inlining Index: gcc/common.opt =================================================================== --- gcc/common.opt (revision 191209) +++ gcc/common.opt (working copy) @@ -1289,7 +1289,7 @@ Perform indirect inlining ; General flag to enable inlining. Specifying -fno-inline will disable ; all inlining apart from always-inline functions. finline -Common Report Var(flag_no_inline,0) Init(0) +Common Report Var(flag_no_inline,0) Init(0) Optimization Enable inlining of function declared \"inline\", disabling disables all inlining finline-small-functions might fix it.