* fix middle-end/15228
@ 2004-06-08 17:43 Richard Henderson
0 siblings, 0 replies; only message in thread
From: Richard Henderson @ 2004-06-08 17:43 UTC (permalink / raw)
To: gcc-patches
i386 only has 4 byte alignment for a lot of its doubles, including
those of the stack. This caused assign_parms to think that it needed
to copy the data in order for it to be valid as a memory.
Fixed by honoring the result of FUNCTION_ARG_BOUNDARY, and by letting
non-strict-alignment targets to never elide their REG_EQUIV note.
r~
* function.c (assign_parms): Always set_mem_align with the computed
FUNCTION_ARG_BOUNDARY. Don't clear stack_parm if !STRICT_ALIGNMENT.
Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.483.4.13
diff -u -p -r1.483.4.13 function.c
--- function.c 18 May 2004 11:08:19 -0000 1.483.4.13
+++ function.c 8 Jun 2004 16:37:17 -0000
@@ -4611,10 +4611,8 @@ assign_parms (tree fndecl)
offset_rtx));
set_mem_attributes (stack_parm, parm, 1);
- if (entry_parm && MEM_ATTRS (stack_parm)->align < PARM_BOUNDARY)
- set_mem_align (stack_parm, PARM_BOUNDARY);
-
- /* Set also REG_ATTRS if parameter was passed in a register. */
+ set_mem_align (stack_parm,
+ FUNCTION_ARG_BOUNDARY (promoted_mode, passed_type));
if (entry_parm)
set_reg_attrs_for_parm (entry_parm, stack_parm);
}
@@ -4688,13 +4686,9 @@ assign_parms (tree fndecl)
/* If we can't trust the parm stack slot to be aligned enough
for its ultimate type, don't use that slot after entry.
We'll make another stack slot, if we need one. */
- {
- unsigned int thisparm_boundary
- = FUNCTION_ARG_BOUNDARY (promoted_mode, passed_type);
-
- if (GET_MODE_ALIGNMENT (nominal_mode) > thisparm_boundary)
- stack_parm = 0;
- }
+ if (STRICT_ALIGNMENT && stack_parm
+ && GET_MODE_ALIGNMENT (nominal_mode) > MEM_ALIGN (stack_parm))
+ stack_parm = 0;
/* If parm was passed in memory, and we need to convert it on entry,
don't store it back in that same slot. */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-06-08 16:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-08 17:43 fix middle-end/15228 Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).