summaryrefslogtreecommitdiff
path: root/gcc/explow.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-22 18:59:36 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-22 18:59:36 +0000
commit024e310889b1a6cf50f5eb2e0463938f899344ca (patch)
treef5e8f6715a0be21af19590c3f435a3e5898db37a /gcc/explow.c
parente55aa207650ecd59f44d03082b6d4ee3f80a13db (diff)
downloadgcc-024e310889b1a6cf50f5eb2e0463938f899344ca.tar.gz
* explow.c (probe_stack_range): Ensure value passed to
stack_check_libfunc is ptr_mode, not Pmode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39185 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/explow.c')
-rw-r--r--gcc/explow.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/gcc/explow.c b/gcc/explow.c
index a1c6380bcc8..aa1e8a69270 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -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