explow.c (probe_stack_range): Ensure value passed to stack_check_libfunc is ptr_mode...
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Mon, 22 Jan 2001 18:59:36 +0000 (18:59 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 22 Jan 2001 18:59:36 +0000 (13:59 -0500)
* explow.c (probe_stack_range): Ensure value passed to
stack_check_libfunc is ptr_mode, not Pmode.

From-SVN: r39185

gcc/ChangeLog
gcc/explow.c

index de416749e654721d4d8ce1896118c9a634cf1937..421766e1c6187ec4b6b51d6e12dad83169271e3c 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jan 22 13:59:09 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * explow.c (probe_stack_range): Ensure value passed to
+       stack_check_libfunc is ptr_mode, not Pmode.
+
 Mon Jan 22 16:53:06 2001  J"orn Rennecke <amylaar@redhat.com>
 
        * recog.c (validate_replace_rtx_1): In ZERO_EXTEND / SIGN_EXTEND
index a1c6380bcc8646635886127ecae2cd392f506f20..aa1e8a6927031c1e3d9400c9f0f08f4dbbd4d1f2 100644 (file)
@@ -1558,12 +1558,20 @@ probe_stack_range (first, size)
   /* First see if the front end has set up a function for us to call to
      check the stack.  */
   if (stack_check_libfunc != 0)
-    emit_library_call (stack_check_libfunc, 0, VOIDmode, 1,
-                      memory_address (QImode,
-                                      gen_rtx (STACK_GROW_OP, Pmode,
-                                               stack_pointer_rtx,
-                                               plus_constant (size, first))),
-                      ptr_mode);
+    {
+      rtx addr = memory_address (QImode,
+                                gen_rtx (STACK_GROW_OP, Pmode,
+                                         stack_pointer_rtx,
+                                         plus_constant (size, first)));
+
+#ifdef POINTERS_EXTEND_UNSIGNED
+      if (GET_MODE (addr) != ptr_mode)
+       addr = convert_memory_address (ptr_mode, addr);
+#endif
+
+      emit_library_call (stack_check_libfunc, 0, VOIDmode, 1, addr,
+                        ptr_mode);
+    }
 
   /* Next see if we have an insn to check the stack.  Use it if so.  */
 #ifdef HAVE_check_stack