Blame SOURCES/gcc48-rh1469697-8.patch

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