Blame SOURCES/gcc48-rh1469697-8.patch

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