diff options
Diffstat (limited to 'gcc/final.c')
-rw-r--r-- | gcc/final.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/final.c b/gcc/final.c index 8c6f6ee..cf649fb 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -4241,7 +4241,9 @@ leaf_function_p (void) { rtx insn; - if (crtl->profile || profile_arc_flag) + /* Some back-ends (e.g. s390) want leaf functions to stay leaf + functions even if they call mcount. */ + if (crtl->profile && !targetm.keep_leaf_when_profiled ()) return 0; for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) |