diff options
author | Qing Zhao <qing.zhao@oracle.com> | 2018-11-29 16:06:03 +0000 |
---|---|---|
committer | Qing Zhao <qinzhao@gcc.gnu.org> | 2018-11-29 16:06:03 +0000 |
commit | 6fd6a2ffee4bc790123d95fc7e638612aa0d7334 (patch) | |
tree | f2ee949591c3fb81f413986103f972a776d98c52 /gcc/cif-code.def | |
parent | 4aff6d17446ade686d1746716906e8b32499a619 (diff) | |
download | gcc-6fd6a2ffee4bc790123d95fc7e638612aa0d7334.zip gcc-6fd6a2ffee4bc790123d95fc7e638612aa0d7334.tar.gz gcc-6fd6a2ffee4bc790123d95fc7e638612aa0d7334.tar.bz2 |
Add a new option -flive-patching={inline-only-static|inline-clone}
to support live patching in GCC.
2018-11-29 qing zhao <qing.zhao@oracle.com>
gcc/ChangeLog:
* cif-code.def (EXTERN_LIVE_ONLY_STATIC): New CIF code.
* common.opt: Add -flive-patching flag.
* doc/invoke.texi: Document -flive-patching.
* flag-types.h (enum live_patching_level): New enum.
* ipa-inline.c (can_inline_edge_p): Disable external functions from
inlining when flag_live_patching is LIVE_PATCHING_INLINE_ONLY_STATIC.
* opts.c (control_options_for_live_patching): New function.
(finish_options): Make flag_live_patching incompatible with flag_lto.
Control IPA optimizations based on different levels of
flag_live_patching.
gcc/testsuite/ChangeLog:
* gcc.dg/live-patching-1.c: New test.
* gcc.dg/live-patching-2.c: New test.
* gcc.dg/live-patching-3.c: New test.
* gcc.dg/tree-ssa/writeonly-3.c: New test.
* gcc.target/i386/ipa-stack-alignment-2.c: New test.
From-SVN: r266627
Diffstat (limited to 'gcc/cif-code.def')
-rw-r--r-- | gcc/cif-code.def | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cif-code.def b/gcc/cif-code.def index 19a7621..ac3f73c 100644 --- a/gcc/cif-code.def +++ b/gcc/cif-code.def @@ -132,6 +132,12 @@ DEFCIFCODE(USES_COMDAT_LOCAL, CIF_FINAL_ERROR, DEFCIFCODE(ATTRIBUTE_MISMATCH, CIF_FINAL_ERROR, N_("function attribute mismatch")) +/* We can't inline because the user requests only static functions + but the function has external linkage for live patching purpose. */ +DEFCIFCODE(EXTERN_LIVE_ONLY_STATIC, CIF_FINAL_ERROR, + N_("function has external linkage when the user requests only" + " inlining static for live patching")) + /* We proved that the call is unreachable. */ DEFCIFCODE(UNREACHABLE, CIF_FINAL_ERROR, N_("unreachable")) |