diff options
author | Jeff Law <law@redhat.com> | 2017-09-19 23:23:51 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2017-09-19 23:23:51 -0600 |
commit | 8a502a808ec70c87e7a0a4bc7719115859a9dd7a (patch) | |
tree | 85770f187da62e84fac032a324ab8303032a2c02 /gcc/function.c | |
parent | 9c1b56c4e739dc6854f1f93526bf7da6f7268095 (diff) | |
download | gcc-8a502a808ec70c87e7a0a4bc7719115859a9dd7a.zip gcc-8a502a808ec70c87e7a0a4bc7719115859a9dd7a.tar.gz gcc-8a502a808ec70c87e7a0a4bc7719115859a9dd7a.tar.bz2 |
function.c (dump_stack_clash_frame_info): New function.
* function.c (dump_stack_clash_frame_info): New function.
* function.h (dump_stack_clash_frame_info): Prototype.
(enum stack_clash_probes): New enum.
From-SVN: r252997
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/gcc/function.c b/gcc/function.c index 3ae5a3a..c03e2ac 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -5681,6 +5681,58 @@ get_arg_pointer_save_area (void) return ret; } + +/* If debugging dumps are requested, dump information about how the + target handled -fstack-check=clash for the prologue. + + PROBES describes what if any probes were emitted. + + RESIDUALS indicates if the prologue had any residual allocation + (i.e. total allocation was not a multiple of PROBE_INTERVAL). */ + +void +dump_stack_clash_frame_info (enum stack_clash_probes probes, bool residuals) +{ + if (!dump_file) + return; + + switch (probes) + { + case NO_PROBE_NO_FRAME: + fprintf (dump_file, + "Stack clash no probe no stack adjustment in prologue.\n"); + break; + case NO_PROBE_SMALL_FRAME: + fprintf (dump_file, + "Stack clash no probe small stack adjustment in prologue.\n"); + break; + case PROBE_INLINE: + fprintf (dump_file, "Stack clash inline probes in prologue.\n"); + break; + case PROBE_LOOP: + fprintf (dump_file, "Stack clash probe loop in prologue.\n"); + break; + } + + if (residuals) + fprintf (dump_file, "Stack clash residual allocation in prologue.\n"); + else + fprintf (dump_file, "Stack clash no residual allocation in prologue.\n"); + + if (frame_pointer_needed) + fprintf (dump_file, "Stack clash frame pointer needed.\n"); + else + fprintf (dump_file, "Stack clash no frame pointer needed.\n"); + + if (TREE_THIS_VOLATILE (cfun->decl)) + fprintf (dump_file, + "Stack clash noreturn prologue, assuming no implicit" + " probes in caller.\n"); + else + fprintf (dump_file, + "Stack clash not noreturn prologue.\n"); +} + /* Add a list of INSNS to the hash HASHP, possibly allocating HASHP for the first time. */ |