mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-23 12:01:15 +08:00
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
This commit is contained in:
parent
9ed5879d10
commit
7ab282a5a0
@ -1,3 +1,9 @@
|
||||
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>
|
||||
|
||||
* gcse.c (delete_null_pointer_checks): Fix typo in previous change.
|
||||
|
@ -2652,18 +2652,23 @@ i960_va_start (stdarg_p, valist, nextarg)
|
||||
tree valist;
|
||||
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);
|
||||
d = build (ARRAY_REF, unsigned_type_node, valist, size_zero_node);
|
||||
t = build (MODIFY_EXPR, unsigned_type_node, d, s);
|
||||
t = build (MODIFY_EXPR, unsigned_type_node, base, s);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
s = build_int_2 ((current_function_args_info.ca_nregparms
|
||||
+ 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, d, s);
|
||||
t = build (MODIFY_EXPR, unsigned_type_node, num, s);
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
}
|
||||
@ -2678,8 +2683,12 @@ i960_va_arg (valist, type)
|
||||
tree base, num, pad, next, this, t1, t2, int48;
|
||||
rtx addr_rtx;
|
||||
|
||||
base = build (ARRAY_REF, unsigned_type_node, valist, size_zero_node);
|
||||
num = build (ARRAY_REF, unsigned_type_node, valist, size_one_node);
|
||||
/* 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))));
|
||||
|
||||
/* Round up sizeof(type) to a word. */
|
||||
siz = (int_size_in_bytes (type) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD;
|
||||
|
Loading…
Reference in New Issue
Block a user