Blame SOURCES/gcc48-rh1469697-5.patch

56d343
commit ea2b372d666ec1105abf4ef5418d92d612283e88
56d343
Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
56d343
Date:   Wed Sep 20 05:23:51 2017 +0000
56d343
56d343
            * function.c (dump_stack_clash_frame_info): New function.
56d343
            * function.h (dump_stack_clash_frame_info): Prototype.
56d343
            (enum stack_clash_probes): New enum.
56d343
    
56d343
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@252997 138bc75d-0d04-0410-961f-82ee72b054a4
56d343
56d343
diff --git a/gcc/function.c b/gcc/function.c
56d343
index 76baf307984..9b395aebcb3 100644
56d343
--- a/gcc/function.c
56d343
+++ b/gcc/function.c
56d343
@@ -5263,6 +5263,58 @@ get_arg_pointer_save_area (void)
56d343
   return ret;
56d343
 }
56d343
 
56d343
+
56d343
+/* If debugging dumps are requested, dump information about how the
56d343
+   target handled -fstack-check=clash for the prologue.
56d343
+
56d343
+   PROBES describes what if any probes were emitted.
56d343
+
56d343
+   RESIDUALS indicates if the prologue had any residual allocation
56d343
+   (i.e. total allocation was not a multiple of PROBE_INTERVAL).  */
56d343
+
56d343
+void
56d343
+dump_stack_clash_frame_info (enum stack_clash_probes probes, bool residuals)
56d343
+{
56d343
+  if (!dump_file)
56d343
+    return;
56d343
+
56d343
+  switch (probes)
56d343
+    {
56d343
+    case NO_PROBE_NO_FRAME:
56d343
+      fprintf (dump_file,
56d343
+	       "Stack clash no probe no stack adjustment in prologue.\n");
56d343
+      break;
56d343
+    case NO_PROBE_SMALL_FRAME:
56d343
+      fprintf (dump_file,
56d343
+	       "Stack clash no probe small stack adjustment in prologue.\n");
56d343
+      break;
56d343
+    case PROBE_INLINE:
56d343
+      fprintf (dump_file, "Stack clash inline probes in prologue.\n");
56d343
+      break;
56d343
+    case PROBE_LOOP:
56d343
+      fprintf (dump_file, "Stack clash probe loop in prologue.\n");
56d343
+      break;
56d343
+    }
56d343
+
56d343
+  if (residuals)
56d343
+    fprintf (dump_file, "Stack clash residual allocation in prologue.\n");
56d343
+  else
56d343
+    fprintf (dump_file, "Stack clash no residual allocation in prologue.\n");
56d343
+
56d343
+  if (frame_pointer_needed)
56d343
+    fprintf (dump_file, "Stack clash frame pointer needed.\n");
56d343
+  else
56d343
+    fprintf (dump_file, "Stack clash no frame pointer needed.\n");
56d343
+
56d343
+  if (TREE_THIS_VOLATILE (cfun->decl))
56d343
+    fprintf (dump_file,
56d343
+	     "Stack clash noreturn prologue, assuming no implicit"
56d343
+	     " probes in caller.\n");
56d343
+  else
56d343
+    fprintf (dump_file,
56d343
+	     "Stack clash not noreturn prologue.\n");
56d343
+}
56d343
+
56d343
 /* Add a list of INSNS to the hash HASHP, possibly allocating HASHP
56d343
    for the first time.  */
56d343
 
56d343
diff --git a/gcc/function.h b/gcc/function.h
56d343
index 89d71e592dd..ffea1e564ba 100644
56d343
--- a/gcc/function.h
56d343
+++ b/gcc/function.h
56d343
@@ -712,6 +712,16 @@ extern void instantiate_decl_rtl (rtx x);
56d343
    and create duplicate blocks.  */
56d343
 extern void reorder_blocks (void);
56d343
 
56d343
+enum stack_clash_probes {
56d343
+  NO_PROBE_NO_FRAME,
56d343
+  NO_PROBE_SMALL_FRAME,
56d343
+  PROBE_INLINE,
56d343
+  PROBE_LOOP
56d343
+};
56d343
+
56d343
+extern void dump_stack_clash_frame_info (enum stack_clash_probes, bool);
56d343
+
56d343
+
56d343
 /* Set BLOCK_NUMBER for all the blocks in FN.  */
56d343
 extern void number_blocks (tree);
56d343