Blame SOURCES/gcc48-rh1469697-8.patch

85359c
commit 93ed472702aad6d9b8998592775a0ab4120b6242
85359c
Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
85359c
Date:   Wed Sep 20 21:59:50 2017 +0000
85359c
85359c
            * explow.c (compute_stack_clash_protection_loop_data): Use
85359c
            CONST_INT_P instead of explicit test.  Verify object is a
85359c
            CONST_INT_P before looking at INTVAL.
85359c
            (anti_adjust_stack_and_probe_stack_clash): Use CONST_INT_P
85359c
            instead of explicit test.
85359c
    
85359c
            * gcc.target/i386/stack-check-11.c: Update test and regexp
85359c
            so that it works for both i?86 and x86_64.
85359c
    
85359c
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253034 138bc75d-0d04-0410-961f-82ee72b054a4
85359c
85359c
diff --git a/gcc/explow.c b/gcc/explow.c
85359c
index 2526e8513b7..d118e0d7782 100644
85359c
--- a/gcc/explow.c
85359c
+++ b/gcc/explow.c
85359c
@@ -1778,11 +1778,11 @@ compute_stack_clash_protection_loop_data (rtx *rounded_size, rtx *last_addr,
85359c
       if (*rounded_size == CONST0_RTX (Pmode))
85359c
 	fprintf (dump_file,
85359c
 		 "Stack clash skipped dynamic allocation and probing loop.\n");
85359c
-      else if (GET_CODE (*rounded_size) == CONST_INT
85359c
+      else if (CONST_INT_P (*rounded_size)
85359c
 	       && INTVAL (*rounded_size) <= 4 * *probe_interval)
85359c
 	fprintf (dump_file,
85359c
 		 "Stack clash dynamic allocation and probing inline.\n");
85359c
-      else if (GET_CODE (*rounded_size) == CONST_INT)
85359c
+      else if (CONST_INT_P (*rounded_size))
85359c
 	fprintf (dump_file,
85359c
 		 "Stack clash dynamic allocation and probing in "
85359c
 		 "rotated loop.\n");
85359c
@@ -1880,7 +1880,8 @@ anti_adjust_stack_and_probe_stack_clash (rtx size)
85359c
 
85359c
   if (rounded_size != CONST0_RTX (Pmode))
85359c
     {
85359c
-      if (INTVAL (rounded_size) <= 4 * probe_interval)
85359c
+      if (CONST_INT_P (rounded_size)
85359c
+	  && INTVAL (rounded_size) <= 4 * probe_interval)
85359c
 	{
85359c
 	  for (HOST_WIDE_INT i = 0;
85359c
 	       i < INTVAL (rounded_size);
85359c
@@ -1900,7 +1901,7 @@ anti_adjust_stack_and_probe_stack_clash (rtx size)
85359c
       else
85359c
 	{
85359c
 	  rtx loop_lab, end_loop;
85359c
-	  bool rotate_loop = GET_CODE (rounded_size) == CONST_INT;
85359c
+	  bool rotate_loop = CONST_INT_P (rounded_size);
85359c
 	  emit_stack_clash_protection_probe_loop_start (&loop_lab, &end_loop,
85359c
 							last_addr, rotate_loop);
85359c
 
85359c
@@ -1938,7 +1939,7 @@ anti_adjust_stack_and_probe_stack_clash (rtx size)
85359c
 	 might hold live data.  So probe at *sp if we know that
85359c
 	 an allocation was made, otherwise probe into the red zone
85359c
 	 which is obviously undesirable.  */
85359c
-      if (GET_CODE (size) == CONST_INT)
85359c
+      if (CONST_INT_P (size))
85359c
 	{
85359c
 	  emit_stack_probe (stack_pointer_rtx);
85359c
 	  emit_insn (gen_blockage ());
85359c
diff --git a/gcc/testsuite/gcc.target/i386/stack-check-11.c b/gcc/testsuite/gcc.target/i386/stack-check-11.c
85359c
index 183103f01e5..fe5b2c2b844 100644
85359c
--- a/gcc/testsuite/gcc.target/i386/stack-check-11.c
85359c
+++ b/gcc/testsuite/gcc.target/i386/stack-check-11.c
85359c
@@ -2,15 +2,17 @@
85359c
 /* { dg-options "-O2 -fstack-clash-protection" } */
85359c
 /* { dg-require-effective-target supports_stack_clash_protection } */
85359c
 
85359c
-extern void arf (unsigned long int *, unsigned long int *);
85359c
+#include <stdint.h>
85359c
+
85359c
+extern void arf (uint64_t *, uint64_t *);
85359c
 void
85359c
 frob ()
85359c
 {
85359c
-  unsigned long int num[859];
85359c
-  unsigned long int den[859];
85359c
+  uint64_t num[859];
85359c
+  uint64_t den[859];
85359c
   arf (den, num);
85359c
 }
85359c
 
85359c
-/* { dg-final { scan-assembler-times "subq" 4 } } */
85359c
-/* { dg-final { scan-assembler-times "orq" 3 } } */
85359c
+/* { dg-final { scan-assembler-times "sub\[ql\]" 4 } } */
85359c
+/* { dg-final { scan-assembler-times "or\[ql\]" 3 } } */
85359c