This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add sequence check to leaf_function_p


On 05/12/2017 07:30 AM, Alexander Monakov wrote:
On Fri, 12 May 2017, Wilco Dijkstra wrote:

This is a followup from: https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02916.html

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).

As I understand, we need to ensure that get_insns call retrieves the topmost
sequence corresponding to the function body, not any current subsequence that
could have been started via start_sequence.  Therefore the 'prolog or epilog'
part is a bit misleading, we could be in a subsequence for other reasons, and
we need to reject those as well.  So, ...
Right. It's not really a prologue/epilogue issue, but anytime we call leaf_function_p and we're not at the topmost sequence there's probably a bug.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]