This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR target/18916; Function arg passing mem align fixes.
Richard Henderson <rth@redhat.com> writes:
> On Thu, Jan 20, 2005 at 09:49:19PM +0000, Richard Sandiford wrote:
>> Is it OK to go back to using "0" as the alignment, or would you prefer
>> something like MIN (TYPE_ALIGN (data->passed_type), BITS_PER_WORD) intead?
>> I suppose another alternative would be to tweak move_block_from_reg
>> to use unaligned stores, but that would be a code-quality regression.
>
> I'm just discussing this with Steven Ellecy.
Doh! Sorry for the duplicate, I tend to read gcc-patches@ before gcc@.
> I think we want both move_block_from_reg fixed and some tweak to the
> alignment here. I'd suggested something based off LOCAL_ALIGNMENT,
> but using a MAX there might be just as good.
OK, I'm bootstrapping the MAX patch now. Should have the results
tomorrow or Saturday.
Richard
Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.602
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.602 function.c
--- function.c 13 Jan 2005 17:06:44 -0000 1.602
+++ function.c 20 Jan 2005 21:54:29 -0000
@@ -2609,7 +2609,8 @@ assign_parm_setup_block (struct assign_p
if (stack_parm == 0)
{
stack_parm = assign_stack_local (BLKmode, size_stored,
- TYPE_ALIGN (data->passed_type));
+ MAX (TYPE_ALIGN (data->passed_type),
+ BITS_PER_WORD));
if (GET_MODE_SIZE (GET_MODE (entry_parm)) == size)
PUT_MODE (stack_parm, GET_MODE (entry_parm));
set_mem_attributes (stack_parm, parm, 1);