13f101
commit c22c3dee4bbf4a99b234307c63e4845052a15890
13f101
Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
13f101
Date:   Thu Sep 21 22:03:59 2017 +0000
13f101
13f101
            * config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash):
13f101
            Fix dump output if the only stack space is for pushed registers.
13f101
    
13f101
            * lib/target-supports.exp
13f101
            (check_effective_target_frame_pointer_for_non_leaf): Add
13f101
            case for x86 Solaris.
13f101
    
13f101
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253082 138bc75d-0d04-0410-961f-82ee72b054a4
13f101
13f101
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
13f101
index a9072f58f50..d8a225195ae 100644
13f101
--- a/gcc/config/i386/i386.c
13f101
+++ b/gcc/config/i386/i386.c
13f101
@@ -9856,7 +9856,16 @@ ix86_adjust_stack_and_probe_stack_clash (const HOST_WIDE_INT size)
13f101
      no probes are needed.  */
13f101
   if (!size)
13f101
     {
13f101
-      dump_stack_clash_frame_info (NO_PROBE_NO_FRAME, false);
13f101
+      struct ix86_frame frame;
13f101
+      ix86_compute_frame_layout (&frame);
13f101
+
13f101
+      /* However, the allocation of space via pushes for register
13f101
+	 saves could be viewed as allocating space, but without the
13f101
+	 need to probe.  */
13f101
+      if (frame.nregs || frame.nsseregs || frame_pointer_needed)
13f101
+        dump_stack_clash_frame_info (NO_PROBE_SMALL_FRAME, true);
13f101
+      else
13f101
+	dump_stack_clash_frame_info (NO_PROBE_NO_FRAME, false);
13f101
       return;
13f101
     }
13f101
 
13f101
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
13f101
index f24c5c6e0ac..7c126e4122b 100644
13f101
--- a/gcc/testsuite/lib/target-supports.exp
13f101
+++ b/gcc/testsuite/lib/target-supports.exp
13f101
@@ -5439,6 +5439,12 @@ proc check_effective_target_frame_pointer_for_non_leaf { } {
13f101
   if { [istarget aarch*-*-*] } {
13f101
 	return 1
13f101
   }
13f101
+
13f101
+  # Solaris/x86 defaults to -fno-omit-frame-pointer.
13f101
+  if { [istarget i?86-*-solaris*] || [istarget x86_64-*-solaris*] } {
13f101
+    return 1
13f101
+  }
13f101
+
13f101
   return 0
13f101
 }
13f101