Blame SOURCES/gcc48-rh1469697-8.patch

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