From 6e3becf7cd895bd16906d9aa0627d98f30a09c6a Mon Sep 17 00:00:00 2001
From: wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 11 Apr 2001 20:19:43 +0000
Subject: [PATCH] Fix PR 2520, a problem with structure parameter passing. 
 * config/ia64/ia64.h (FUNCTION_ARG_BOUNDARY): Return 128 if argument 
 requires more than 64 bits of alignment.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41269 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog          |  5 +++++
 gcc/config/ia64/ia64.h | 10 +++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 12198f23542a..9ff706e65324 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2001-04-11  Jim Wilson  <wilson@redhat.com>
+
+	* config/ia64/ia64.h (FUNCTION_ARG_BOUNDARY): Return 128 if argument
+	requires more than 64 bits of alignment.
+
 2001-04-11  Neil Booth  <neil@daikokuya.demon.co.uk>
 
 	* cpplib.c (do_line): Sanity check iff enable checking.
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 8acbef13127a..956abd02a327 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1382,11 +1382,15 @@ do {									\
 /* If defined, a C expression that gives the alignment boundary, in bits, of an
    argument with the specified mode and type.  */
 
-/* Arguments larger than 64 bits require 128 bit alignment.  */
+/* Arguments with alignment larger than 8 bytes start at the next even
+   boundary.  See ia64_function_arg.  */
 
 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
-  (((((MODE) == BLKmode ? int_size_in_bytes (TYPE) : GET_MODE_SIZE (MODE)) \
-     + UNITS_PER_WORD - 1) / UNITS_PER_WORD) > 1 ? 128 : PARM_BOUNDARY)
+  (((TYPE) ? (TYPE_ALIGN (TYPE) > 8 * BITS_PER_UNIT)		\
+    : (((((MODE) == BLKmode					\
+	  ? int_size_in_bytes (TYPE) : GET_MODE_SIZE (MODE))	\
+	 + UNITS_PER_WORD - 1) / UNITS_PER_WORD) > 1))		\
+    ? 128 : PARM_BOUNDARY)
 
 /* A C expression that is nonzero if REGNO is the number of a hard register in
    which function arguments are sometimes passed.  This does *not* include
-- 
GitLab