Commit 7ab282a5 by Jim Wilson Committed by Jim Wilson

Fix i960 varargs/stdarg build failures.

	* config/i960/i960.c (i960_va_start): New locals base, num.
	Use INDIRECT_REF instead of ARRAY_REF on valist.
	(i960_va_arg): Use INDIRECT_REF instead of ARRAY_REF on valist.

From-SVN: r30244
parent 9ed5879d
Thu Oct 28 10:02:00 1999 Jim Wilson <wilson@cygnus.com>
* config/i960/i960.c (i960_va_start): New locals base, num.
Use INDIRECT_REF instead of ARRAY_REF on valist.
(i960_va_arg): Use INDIRECT_REF instead of ARRAY_REF on valist.
Thu Oct 28 09:45:48 1999 Mark Mitchell <mark@codesourcery.com> Thu Oct 28 09:45:48 1999 Mark Mitchell <mark@codesourcery.com>
* gcse.c (delete_null_pointer_checks): Fix typo in previous change. * gcse.c (delete_null_pointer_checks): Fix typo in previous change.
......
...@@ -2652,18 +2652,23 @@ i960_va_start (stdarg_p, valist, nextarg) ...@@ -2652,18 +2652,23 @@ i960_va_start (stdarg_p, valist, nextarg)
tree valist; tree valist;
rtx nextarg ATTRIBUTE_UNUSED; rtx nextarg ATTRIBUTE_UNUSED;
{ {
tree d, s, t; tree s, t, base, num;
/* The array type always decays to a pointer before we get here, so we
can't use ARRAY_REF. */
base = build1 (INDIRECT_REF, unsigned_type_node, valist);
num = build1 (INDIRECT_REF, unsigned_type_node,
build (PLUS_EXPR, unsigned_type_node, valist,
TYPE_SIZE_UNIT (TREE_TYPE (valist))));
s = make_tree (unsigned_type_node, arg_pointer_rtx); s = make_tree (unsigned_type_node, arg_pointer_rtx);
d = build (ARRAY_REF, unsigned_type_node, valist, size_zero_node); t = build (MODIFY_EXPR, unsigned_type_node, base, s);
t = build (MODIFY_EXPR, unsigned_type_node, d, s);
TREE_SIDE_EFFECTS (t) = 1; TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
s = build_int_2 ((current_function_args_info.ca_nregparms s = build_int_2 ((current_function_args_info.ca_nregparms
+ current_function_args_info.ca_nstackparms) * 4, 0); + current_function_args_info.ca_nstackparms) * 4, 0);
d = build (ARRAY_REF, unsigned_type_node, valist, size_one_node); t = build (MODIFY_EXPR, unsigned_type_node, num, s);
t = build (MODIFY_EXPR, unsigned_type_node, d, s);
TREE_SIDE_EFFECTS (t) = 1; TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
} }
...@@ -2678,8 +2683,12 @@ i960_va_arg (valist, type) ...@@ -2678,8 +2683,12 @@ i960_va_arg (valist, type)
tree base, num, pad, next, this, t1, t2, int48; tree base, num, pad, next, this, t1, t2, int48;
rtx addr_rtx; rtx addr_rtx;
base = build (ARRAY_REF, unsigned_type_node, valist, size_zero_node); /* The array type always decays to a pointer before we get here, so we
num = build (ARRAY_REF, unsigned_type_node, valist, size_one_node); can't use ARRAY_REF. */
base = build1 (INDIRECT_REF, unsigned_type_node, valist);
num = build1 (INDIRECT_REF, unsigned_type_node,
build (PLUS_EXPR, unsigned_type_node, valist,
TYPE_SIZE_UNIT (TREE_TYPE (valist))));
/* Round up sizeof(type) to a word. */ /* Round up sizeof(type) to a word. */
siz = (int_size_in_bytes (type) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD; siz = (int_size_in_bytes (type) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD;
......
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