This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][4.0] Fix PR15366, -fno-inline-functions is ignored for staticfunctions
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 31 Aug 2005 15:00:58 +0200 (CEST)
- Subject: [PATCH][4.0] Fix PR15366, -fno-inline-functions is ignored for staticfunctions
.. in the same way as the 4.1 patch, add
-fno-inline-functions-called-once.
Ok for 4.0?
Thanks,
Richard.
2005-08-31 Richard Guenther <rguenther@suse.de>
PR tree-optimization/15366
* common.opt: Add -finline-functions-called-once.
* doc/invoke.texi: Document new option.
* cgraphunit.c (cgraph_decide_inlining): Honour
flag_inline_functions_called_once.
Index: common.opt
===================================================================
RCS file: /cvs/gcc/gcc/gcc/common.opt,v
retrieving revision 1.62.2.1
diff -c -3 -p -r1.62.2.1 common.opt
*** common.opt 6 Apr 2005 19:35:31 -0000 1.62.2.1
--- common.opt 31 Aug 2005 12:47:54 -0000
*************** finline-functions
*** 465,470 ****
--- 465,474 ----
Common Report Var(flag_inline_functions)
Integrate simple functions into their callers
+ finline-functions-called-once
+ Common Report Var(flag_inline_functions_called_once) Init(1)
+ Integrate functions called once into their callers
+
finline-limit-
Common RejectNegative Joined UInteger
Index: cgraphunit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraphunit.c,v
retrieving revision 1.93.2.4
diff -c -3 -p -r1.93.2.4 cgraphunit.c
*** cgraphunit.c 1 Apr 2005 21:35:59 -0000 1.93.2.4
--- cgraphunit.c 31 Aug 2005 12:47:54 -0000
*************** cgraph_decide_inlining (void)
*** 1546,1554 ****
}
if (!flag_really_no_inline)
! {
! cgraph_decide_inlining_of_small_functions ();
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "\nDeciding on functions called once:\n");
--- 1546,1556 ----
}
if (!flag_really_no_inline)
! cgraph_decide_inlining_of_small_functions ();
+ if (!flag_really_no_inline
+ && flag_inline_functions_called_once)
+ {
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "\nDeciding on functions called once:\n");
Index: doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.583.2.24
diff -c -3 -p -r1.583.2.24 invoke.texi
*** doc/invoke.texi 19 Aug 2005 17:54:52 -0000 1.583.2.24
--- doc/invoke.texi 31 Aug 2005 12:47:54 -0000
*************** Objective-C and Objective-C++ Dialects}.
*** 292,298 ****
-fforce-addr -fforce-mem -ffunction-sections @gol
-fgcse -fgcse-lm -fgcse-sm -fgcse-las -fgcse-after-reload @gol
-floop-optimize -fcrossjumping -fif-conversion -fif-conversion2 @gol
! -finline-functions -finline-limit=@var{n} -fkeep-inline-functions @gol
-fkeep-static-consts -fmerge-constants -fmerge-all-constants @gol
-fmodulo-sched -fno-branch-count-reg @gol
-fno-default-inline -fno-defer-pop -floop-optimize2 -fmove-loop-invariants @gol
--- 292,299 ----
-fforce-addr -fforce-mem -ffunction-sections @gol
-fgcse -fgcse-lm -fgcse-sm -fgcse-las -fgcse-after-reload @gol
-floop-optimize -fcrossjumping -fif-conversion -fif-conversion2 @gol
! -finline-functions -finline-functions-called-once @gol
! -finline-limit=@var{n} -fkeep-inline-functions @gol
-fkeep-static-consts -fmerge-constants -fmerge-all-constants @gol
-fmodulo-sched -fno-branch-count-reg @gol
-fno-default-inline -fno-defer-pop -floop-optimize2 -fmove-loop-invariants @gol
*************** assembler code in its own right.
*** 4266,4271 ****
--- 4267,4283 ----
Enabled at level @option{-O3}.
+ @item -finline-functions-called-once
+ @opindex finline-functions-called-once
+ Integrate all functions called once into their callers. The compiler
+ heuristically decides which functions are simple enough to be worth
+ integrating in this way.
+
+ If a calls to a given function is integrated, then the function is
+ not output as assembler code in its own right.
+
+ Enabled if @option{-funit-at-a-time} is enabled.
+
@item -finline-limit=@var{n}
@opindex finline-limit
By default, GCC limits the size of functions that can be inlined. This flag