e->inline_failed = CIF_SANITIZE_ATTRIBUTE_MISMATCH;
inlinable = false;
}
+ else if (profile_arc_flag
+ && (lookup_attribute ("no_profile_instrument_function",
+ DECL_ATTRIBUTES (caller->decl)) == NULL_TREE)
+ != (lookup_attribute ("no_profile_instrument_function",
+ DECL_ATTRIBUTES (callee->decl)) == NULL_TREE))
+ {
+ cgraph_node *origin = caller;
+ while (origin->clone_of)
+ origin = origin->clone_of;
+
+ if (!DECL_STRUCT_FUNCTION (origin->decl)->always_inline_functions_inlined)
+ {
+ e->inline_failed = CIF_UNSPECIFIED;
+ inlinable = false;
+ }
+ }
+
if (!inlinable && report)
report_inline_failed_reason (e);
return inlinable;
--- /dev/null
+/* { dg-require-effective-target global_constructor } */
+/* { dg-options "-O2 -fprofile-generate -fprofile-update=single -fdump-tree-optimized" } */
+
+__attribute__ ((no_profile_instrument_function))
+int foo()
+{
+ return 0;
+}
+
+int bar()
+{
+ return foo();
+}
+
+/* { dg-final { scan-tree-dump-not" = foo \\(\\)" "optimized"} } */