summaryrefslogtreecommitdiff
path: root/gcc/explow.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-23 22:59:15 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2001-10-23 22:59:15 +0000
commit479e4d5e1b15ee85a3cd4dbda8e2b2577d298226 (patch)
treefa0e244bdad0d095044fbe7bb7bb53c3b667a4bb /gcc/explow.c
parent79d44e49222c7e8366abb1226d13d3344707f0ab (diff)
downloadgcc-479e4d5e1b15ee85a3cd4dbda8e2b2577d298226.tar.gz
* builtins.c (expand_builtin_setjmp): Only call convert_memory_address
if needed. (expand_builtin_longjmp, expand_builtin_alloca): Likewise. * except.c (expand_builtin_frob_return_addr): Likewise. (expand_builtin_eh_return): Likewise. * stmt.c (expand_computed_goto): Likewise. * explow.c (memory_address): Likewise. (allocate_dynamic_stack_space): Clean up predicate testing. (probe_stack_range): Convert SIZE to Pmode. * calls.c (rtx_for_function_call): Only call convert_memory_address if needed. Pass function call operand as ptr_mode, not Pmode. * expr.c (expand_assignment): Clean up calls to convert_memory address by only doing so when needed and making offsets Pmode. (store_constructor, expand_expr, expand_expr_unaligned): Likewise. * function.c (assign_parms): Ensure address in MEM for RESULT_DECL is in Pmode, not ptr_mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46448 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/explow.c')
-rw-r--r--gcc/explow.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/explow.c b/gcc/explow.c
index 533fe57deeb..d0735aab78a 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -472,7 +472,7 @@ memory_address (mode, x)
return x;
#ifdef POINTERS_EXTEND_UNSIGNED
- if (GET_MODE (x) == ptr_mode)
+ if (GET_MODE (x) != Pmode)
x = convert_memory_address (Pmode, x);
#endif
@@ -1318,16 +1318,12 @@ allocate_dynamic_stack_space (size, target, known_align)
enum machine_mode mode = STACK_SIZE_MODE;
insn_operand_predicate_fn pred;
- pred = insn_data[(int) CODE_FOR_allocate_stack].operand[0].predicate;
- if (pred && ! ((*pred) (target, Pmode)))
-#ifdef POINTERS_EXTEND_UNSIGNED
- target = convert_memory_address (Pmode, target);
-#else
- target = copy_to_mode_reg (Pmode, target);
-#endif
-
+ /* We don't have to check against the predicate for operand 0 since
+ TARGET is known to be a pseudo of the proper mode, which must
+ be valid for the operand. For operand 1, convert to the
+ proper mode and validate. */
if (mode == VOIDmode)
- mode = Pmode;
+ mode = insn_data[(int) CODE_FOR_allocate_stack].operand[1].mode;
pred = insn_data[(int) CODE_FOR_allocate_stack].operand[1].predicate;
if (pred && ! ((*pred) (size, mode)))
@@ -1461,7 +1457,11 @@ probe_stack_range (first, size)
HOST_WIDE_INT first;
rtx size;
{
- /* First see if the front end has set up a function for us to call to
+ /* First ensure SIZE is Pmode. */
+ if (GET_MODE (size) != VOIDmode && GET_MODE (size) != Pmode)
+ size = convert_to_mode (Pmode, size, 1);
+
+ /* Next see if the front end has set up a function for us to call to
check the stack. */
if (stack_check_libfunc != 0)
{