Blame SOURCES/gcc48-rh1469697-5.patch

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