[PATCH][Middle-end][Version 3]Add a new option to control inlining only on static functions

Qing Zhao qing.zhao@oracle.com
Tue Sep 18 18:58:00 GMT 2018


Hi,

this is the 3rd version of the patch, the major change is to address Andrew’s concern on the documentation part.

I updated the documentation of this option as following:

'-finline-only-static'
     By default, GCC inlines functions without considering whether they
     are static or not.  This flag guides inliner to only inline static
     functions.  This option has any effect only when inlining itself is
     turned on by the -finline-functions or -finline-small-fiunctions.

     Off by default.

all other changes keep the same as version 2.

please take a look again. and let me know any comment and suggestion.

thanks.

Qing

gcc/ChangeLog

+2018-09-18  Qing Zhao  <qing.zhao@oracle.com>
+
+	* cif-code.def (FUNCTION_EXTERN): New CIFCODE.
+	* common.opt (-finline-only-static): New option.
+	* doc/invoke.texi: Document -finline-only-static.
+	* ipa-inline.c (can_inline_edge_p): Control inlining based on
+	function's visibility. 

gcc/testsuite/ChangeLog

+2018-09-18  Qing Zhao  <qing.zhao@oracle.com>
+
+	* gcc.dg/inline_only_static.c: New test.
+

-------------- next part --------------
A non-text attachment was scrubbed...
Name: New-inline-only-static.patch
Type: application/octet-stream
Size: 4004 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180918/fadf376f/attachment.obj>


More information about the Gcc-patches mailing list