Commit 00d60013 by Wilco Dijkstra Committed by Wilco Dijkstra

Add an assert to leaf_function_p to ensure it is not called from a prolog or...

Add an assert to leaf_function_p to ensure it is not called from a
prolog or epilog sequence (which would incorrectly return true in a
non-leaf function).  There are several targets which still call
leaf_function_p, and while most appear safe or appear aware of the
issue, it is likely not all such calls are safe.  This check enables
any such latent bugs to be found.

    gcc/
	* final.c (leaf_function_p): Check we are not in a sequence.

From-SVN: r248240
parent 2063b07f
2017-05-18 Wilco Dijkstra <wdijkstr@arm.com>
* final.c (leaf_function_p): Check we are not in a sequence.
2017-05-18 Martin Liska <mliska@suse.cz>
* cfgrtl.c (rtl_verify_edges): Remove usage of TDF_RTL.
......
......@@ -4309,6 +4309,9 @@ leaf_function_p (void)
{
rtx_insn *insn;
/* Ensure we walk the entire function body. */
gcc_assert (!in_sequence_p ());
/* 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 ())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment