diff options
author | Eric Botcazou <ebotcazou@libertysurf.fr> | 2003-11-27 06:20:11 +0100 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2003-11-27 05:20:11 +0000 |
commit | 316d0b19813c17613fe2dd80f8bba4fd2001eca3 (patch) | |
tree | 946c3c7c87e191ddb13beb07b342cb71173d930b /gcc/builtins.c | |
parent | 27f0f55216eeea3cc81612ecbc235d7704382a77 (diff) | |
download | gcc-316d0b19813c17613fe2dd80f8bba4fd2001eca3.zip gcc-316d0b19813c17613fe2dd80f8bba4fd2001eca3.tar.gz gcc-316d0b19813c17613fe2dd80f8bba4fd2001eca3.tar.bz2 |
re PR middle-end/8028 (__builtin_apply() passes wrong arguments)
PR middle-end/8028
PR middle-end/9890
PR middle-end/11151
PR middle-end/12210
PR middle-end/12503
PR middle-end/12692
* builtins.c (expand_builtin_apply): Use virtual_outgoing_args_rtx
as the base address to copy the memory arguments to.
From-SVN: r73976
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 7ff8789..a48c5af 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -1219,12 +1219,16 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize) #endif emit_stack_save (SAVE_BLOCK, &old_stack_level, NULL_RTX); - /* Push a block of memory onto the stack to store the memory arguments. - Save the address in a register, and copy the memory arguments. ??? I - haven't figured out how the calling convention macros effect this, - but it's likely that the source and/or destination addresses in - the block copy will need updating in machine specific ways. */ - dest = allocate_dynamic_stack_space (argsize, 0, BITS_PER_UNIT); + /* Allocate a block of memory onto the stack and copy the memory + arguments to the outgoing arguments address. */ + allocate_dynamic_stack_space (argsize, 0, BITS_PER_UNIT); + dest = virtual_outgoing_args_rtx; +#ifndef STACK_GROWS_DOWNWARD + if (GET_CODE (argsize) == CONST_INT) + dest = plus_constant (dest, -INTVAL (argsize)); + else + dest = gen_rtx_PLUS (Pmode, dest, negate_rtx (Pmode, argsize)); +#endif dest = gen_rtx_MEM (BLKmode, dest); set_mem_align (dest, PARM_BOUNDARY); src = gen_rtx_MEM (BLKmode, incoming_args); |