aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-06-19 12:24:56 -0700
committerJohn David Anglin <danglin@gcc.gnu.org>2004-06-19 19:24:56 +0000
commitebca59c355524893ef3facf6ad12074e4661348e (patch)
tree3bfa4addf632b7aea8ae5a0a38303b051c63876d
parent8426c25e7c2351b1f1f7a48d3ec01a79622f558c (diff)
downloadgcc-ebca59c355524893ef3facf6ad12074e4661348e.zip
gcc-ebca59c355524893ef3facf6ad12074e4661348e.tar.gz
gcc-ebca59c355524893ef3facf6ad12074e4661348e.tar.bz2
re PR target/15941 (new fails gcc.dg/compat/struct-by-value-11 and gcc.dg/compat/struct-by-value-1)
PR target/15941 * function.c (assign_parms): If not padding upward or intentionally forcing upward padding, take offset_rtx into account when determining the alignment for stack_parm. From-SVN: r83396
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/function.c21
2 files changed, 26 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 07e75cd..242be1c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2004-06-19 Richard Henderson <rth@redhat.com>
+ PR target/15941
+ * function.c (assign_parms): If not padding upward or intentionally
+ forcing upward padding, take offset_rtx into account when determining
+ the alignment for stack_parm.
+
+2004-06-19 Richard Henderson <rth@redhat.com>
+
PR target/15550
* ifcvt.c (noce_try_move): Recognize all generated instructions.
diff --git a/gcc/function.c b/gcc/function.c
index f4f2940..3f1f45b 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -4603,6 +4603,7 @@ assign_parms (tree fndecl)
{
rtx offset_rtx;
+ unsigned int align, boundary;
/* If we're passing this arg using a reg, make its stack home
the aligned stack slot. */
@@ -4620,8 +4621,24 @@ assign_parms (tree fndecl)
offset_rtx));
set_mem_attributes (stack_parm, parm, 1);
- set_mem_align (stack_parm,
- FUNCTION_ARG_BOUNDARY (promoted_mode, passed_type));
+
+ boundary = FUNCTION_ARG_BOUNDARY (promoted_mode, passed_type);
+ align = 0;
+
+ /* If we're padding upward, we know that the alignment of the slot
+ is FUNCTION_ARG_BOUNDARY. If we're using slot_offset, we're
+ intentionally forcing upward padding. Otherwise we have to come
+ up with a guess at the alignment based on OFFSET_RTX. */
+ if (locate.where_pad == upward || entry_parm)
+ align = boundary;
+ else if (GET_CODE (offset_rtx) == CONST_INT)
+ {
+ align = INTVAL (offset_rtx) * BITS_PER_UNIT | boundary;
+ align = align & -align;
+ }
+ if (align > 0)
+ set_mem_align (stack_parm, align);
+
if (entry_parm)
set_reg_attrs_for_parm (entry_parm, stack_parm);
}