Commit 7d17b34d by Jim Wilson Committed by Jim Wilson

Finish ABI change started by last patch, this time I tested it.

	* config/ia64/ia64.c (ia64_function_arg): Fix last change.  Verify
	type exists before using it.  Use number of words as alignment
	otherwise.
	(ia64_function_arg_partial_nregs, ia64_function_arg_advance,
	ia64_va_arg): Propagate ia64_function_args changes here.

From-SVN: r35413
parent 0577bad8
2000-08-01 Jim Wilson <wilson@cygnus.com>
* config/ia64/ia64.c (ia64_function_arg): Fix last change. Verify
type exists before using it. Use number of words as alignment
otherwise.
(ia64_function_arg_partial_nregs, ia64_function_arg_advance,
ia64_va_arg): Propagate ia64_function_args changes here.
2000-08-01 Richard Henderson <rth@cygnus.com> 2000-08-01 Richard Henderson <rth@cygnus.com>
* config/elfos.h (ASM_DECLARE_OBJECT_NAME): Care for null DECL. * config/elfos.h (ASM_DECLARE_OBJECT_NAME): Care for null DECL.
......
...@@ -1544,12 +1544,15 @@ ia64_function_arg (cum, mode, type, named, incoming) ...@@ -1544,12 +1544,15 @@ ia64_function_arg (cum, mode, type, named, incoming)
/* Integer and float arguments larger than 8 bytes start at the next even /* Integer and float arguments larger than 8 bytes start at the next even
boundary. Aggregates larger than 8 bytes start at the next even boundary boundary. Aggregates larger than 8 bytes start at the next even boundary
if the aggregate has 16 byte alignment. */ if the aggregate has 16 byte alignment. Net effect is that types with
alignment greater than 8 start at the next even boundary. */
/* ??? The ABI does not specify how to handle aggregates with alignment from /* ??? The ABI does not specify how to handle aggregates with alignment from
9 to 15 bytes, or greater than 16. We handle them all as if they had 9 to 15 bytes, or greater than 16. We handle them all as if they had
16 byte alignment. Such aggregates can occur only if gcc extensions are 16 byte alignment. Such aggregates can occur only if gcc extensions are
used. */ used. */
if ((TYPE_ALIGN (type) > 8 * BITS_PER_UNIT) && (cum->words & 1)) if ((type ? (TYPE_ALIGN (type) > 8 * BITS_PER_UNIT)
: (words > 1))
&& (cum->words & 1))
offset = 1; offset = 1;
/* If all argument slots are used, then it must go on the stack. */ /* If all argument slots are used, then it must go on the stack. */
...@@ -1690,8 +1693,11 @@ ia64_function_arg_partial_nregs (cum, mode, type, named) ...@@ -1690,8 +1693,11 @@ ia64_function_arg_partial_nregs (cum, mode, type, named)
/ UNITS_PER_WORD); / UNITS_PER_WORD);
int offset = 0; int offset = 0;
/* Arguments larger than 8 bytes start at the next even boundary. */ /* Arguments with alignment larger than 8 bytes start at the next even
if (words > 1 && (cum->words & 1)) boundary. */
if ((type ? (TYPE_ALIGN (type) > 8 * BITS_PER_UNIT)
: (words > 1))
&& (cum->words & 1))
offset = 1; offset = 1;
/* If all argument slots are used, then it must go on the stack. */ /* If all argument slots are used, then it must go on the stack. */
...@@ -1729,8 +1735,11 @@ ia64_function_arg_advance (cum, mode, type, named) ...@@ -1729,8 +1735,11 @@ ia64_function_arg_advance (cum, mode, type, named)
if (cum->words >= MAX_ARGUMENT_SLOTS) if (cum->words >= MAX_ARGUMENT_SLOTS)
return; return;
/* Arguments larger than 8 bytes start at the next even boundary. */ /* Arguments with alignment larger than 8 bytes start at the next even
if (words > 1 && (cum->words & 1)) boundary. */
if ((type ? (TYPE_ALIGN (type) > 8 * BITS_PER_UNIT)
: (words > 1))
&& (cum->words & 1))
offset = 1; offset = 1;
cum->words += words + offset; cum->words += words + offset;
...@@ -1832,9 +1841,9 @@ ia64_va_arg (valist, type) ...@@ -1832,9 +1841,9 @@ ia64_va_arg (valist, type)
HOST_WIDE_INT size; HOST_WIDE_INT size;
tree t; tree t;
/* Arguments larger than 8 bytes are 16 byte aligned. */ /* Arguments with alignment larger than 8 bytes start at the next even
size = int_size_in_bytes (type); boundary. */
if (size > UNITS_PER_WORD) if (TYPE_ALIGN (type) > 8 * BITS_PER_UNIT)
{ {
t = build (PLUS_EXPR, TREE_TYPE (valist), valist, t = build (PLUS_EXPR, TREE_TYPE (valist), valist,
build_int_2 (2 * UNITS_PER_WORD - 1, 0)); build_int_2 (2 * UNITS_PER_WORD - 1, 0));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment