aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-06-16 06:53:32 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-06-16 06:53:32 -0400
commit1d783d3118325060c76b2f657d76e7fe0eed345e (patch)
treebf5280a7a8553aa7bc120d04cf5e70903f1e7704 /gcc
parentd3c89e1f6c85d4ed5a1f474189ef0dde571ee2de (diff)
downloadgcc-1d783d3118325060c76b2f657d76e7fe0eed345e.zip
gcc-1d783d3118325060c76b2f657d76e7fe0eed345e.tar.gz
gcc-1d783d3118325060c76b2f657d76e7fe0eed345e.tar.bz2
(alpha_builtin_saveregs): Use ptr_mode and conversions when need so
works for both OSF and NT. From-SVN: r9995
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/alpha/alpha.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index bdcd305..cd67fe3 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -1156,20 +1156,27 @@ alpha_builtin_saveregs (arglist)
? plus_constant (virtual_incoming_args_rtx, 6 * UNITS_PER_WORD)
: plus_constant (virtual_incoming_args_rtx, - (6 * UNITS_PER_WORD)));
+ addr = force_operand (addr, NULL_RTX);
+
/* Allocate the va_list constructor */
block = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD);
RTX_UNCHANGING_P (block) = 1;
RTX_UNCHANGING_P (XEXP (block, 0)) = 1;
- /* Store the address of the first integer register in the
- __va_base member. */
- emit_move_insn (change_address (block, Pmode, XEXP (block, 0)),
- force_operand (addr, NULL_RTX));
+ /* Store the address of the first integer register in the __base member.
+ Note that our offsets are correct for both 32- and 64-bit pointers
+ due to the alignment of the __offset field (a long). */
+
+#ifdef POINTERS_EXTEND_UNSIGNED
+ addr = convert_memory_address (ptr_mode, addr);
+#endif
+
+ emit_move_insn (change_address (block, ptr_mode, XEXP (block, 0)), addr);
/* Store the argsize as the __va_offset member. */
- emit_move_insn (change_address (block, Pmode,
+ emit_move_insn (change_address (block, ptr_mode,
plus_constant (XEXP (block, 0),
- UNITS_PER_WORD)),
+ GET_MODE_SIZE (ptr_mode))),
force_operand (argsize, NULL_RTX));
/* Return the address of the va_list constructor, but don't put it in a