This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/54553] atribute optimize on function affects optimization for other functions
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 12 Sep 2012 09:33:25 +0000
- Subject: [Bug middle-end/54553] atribute optimize on function affects optimization for other functions
- Auto-submitted: auto-generated
- References: <bug-54553-4@http.gcc.gnu.org/bugzilla/>
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.