+2019-04-03 qing zhao <qing.zhao@oracle.com>
+
+ PR tree-optimization/89730
+ * ipa-inline.c (can_inline_edge_p): Delete the checking for
+ -flive-patching=inline-only-static.
+ (can_inline_edge_by_limits_p): Add the checking for
+ -flive-patching=inline-only-static and grant always_inline
+ even when -flive-patching=inline-only-static is specified.
+
2019-04-03 Jeff Law <law@redhat.com>
PR rtl-optimization/81025
e->inline_failed = CIF_ATTRIBUTE_MISMATCH;
inlinable = false;
}
- else if (callee->externally_visible
- && flag_live_patching == LIVE_PATCHING_INLINE_ONLY_STATIC)
- {
- e->inline_failed = CIF_EXTERN_LIVE_ONLY_STATIC;
- inlinable = false;
- }
if (!inlinable && report)
report_inline_failed_reason (e);
return inlinable;
DECL_ATTRIBUTES (caller->decl))
&& !caller_growth_limits (e))
inlinable = false;
+ else if (callee->externally_visible
+ && !DECL_DISREGARD_INLINE_LIMITS (callee->decl)
+ && flag_live_patching == LIVE_PATCHING_INLINE_ONLY_STATIC)
+ {
+ e->inline_failed = CIF_EXTERN_LIVE_ONLY_STATIC;
+ inlinable = false;
+ }
/* Don't inline a function with a higher optimization level than the
caller. FIXME: this is really just tip of iceberg of handling
optimization attribute. */
+2019-04-03 qing zhao <qing.zhao@oracle.com>
+
+ PR tree-optimization/89730
+ * gcc.dg/live-patching-4.c: New test.
+
2019-04-03 Clément Chigot <clement.chigot@atos.net>
* lib/go-torture.exp: Only add lto to TORTURE_OPTIONS if it is
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -flive-patching=inline-only-static -fdump-tree-einline-optimized" } */
+
+extern int sum, n, m;
+
+extern inline __attribute__((always_inline)) int foo (int a);
+inline __attribute__((always_inline)) int foo (int a)
+{
+ return a + n;
+}
+
+static int bar (int b)
+{
+ return b * m;
+}
+
+int main()
+{
+ sum = foo (m) + bar (n);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "Inlining foo/0 into main/2" "einline" } } */