aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r--gcc/ipa-inline.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 31c88e50..3dadf8d 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -284,6 +284,14 @@ can_inline_edge_p (struct cgraph_edge *e, bool report)
e->inline_failed = CIF_EH_PERSONALITY;
inlinable = false;
}
+ /* TM pure functions should not get inlined if the outer function is
+ a TM safe function. */
+ else if (is_tm_pure (callee->decl)
+ && is_tm_safe (e->caller->decl))
+ {
+ e->inline_failed = CIF_UNSPECIFIED;
+ inlinable = false;
+ }
/* Don't inline if the callee can throw non-call exceptions but the
caller cannot.
FIXME: this is obviously wrong for LTO where STRUCT_FUNCTION is missing.