Commit ac7e839c by Alan Modra Committed by Fariborz Jahanian

Fix for latent bug in splitting arguments exposed by rs6000_arg_partial_bytes rewrite.

Fix for latent bug in splitting arguments exposed by
rs6000_arg_partial_bytes rewrite.
Oked by Richard Henderson.

Co-Authored-By: Fariborz Jahanian <fjahanian@apple.com>

From-SVN: r98507
parent 452ff12a
2005-04-21 Alan Modra <amodra@bigpond.net.au>
Fariborz Jahanian <fjahanian@apple.com>
* config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Fix size of
portion of argument passed in fpr.
*expr.c (emit_push_insn): Fix computation of 'offset' used to
decide on partial argument save on stack.
2005-04-21 Kazu Hirata <kazu@cs.umass.edu> 2005-04-21 Kazu Hirata <kazu@cs.umass.edu>
* config/sparc/predicates.md, config/sparc/sparc.md: Fix * config/sparc/predicates.md, config/sparc/sparc.md: Fix
......
...@@ -4951,16 +4951,14 @@ rs6000_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode, ...@@ -4951,16 +4951,14 @@ rs6000_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
&& align_words >= GP_ARG_NUM_REG)))) && align_words >= GP_ARG_NUM_REG))))
{ {
if (cum->fregno + ((GET_MODE_SIZE (mode) + 7) >> 3) > FP_ARG_MAX_REG + 1) if (cum->fregno + ((GET_MODE_SIZE (mode) + 7) >> 3) > FP_ARG_MAX_REG + 1)
ret = FP_ARG_MAX_REG + 1 - cum->fregno; ret = (FP_ARG_MAX_REG + 1 - cum->fregno) * 8;
else if (cum->nargs_prototype >= 0) else if (cum->nargs_prototype >= 0)
return 0; return 0;
} }
if (align_words < GP_ARG_NUM_REG if (align_words < GP_ARG_NUM_REG
&& GP_ARG_NUM_REG < align_words + rs6000_arg_size (mode, type)) && GP_ARG_NUM_REG < align_words + rs6000_arg_size (mode, type))
ret = GP_ARG_NUM_REG - align_words; ret = (GP_ARG_NUM_REG - align_words) * (TARGET_32BIT ? 4 : 8);
ret *= (TARGET_32BIT ? 4 : 8);
if (ret != 0 && TARGET_DEBUG_ARG) if (ret != 0 && TARGET_DEBUG_ARG)
fprintf (stderr, "rs6000_arg_partial_bytes: %d\n", ret); fprintf (stderr, "rs6000_arg_partial_bytes: %d\n", ret);
......
...@@ -3544,7 +3544,7 @@ emit_push_insn (rtx x, enum machine_mode mode, tree type, rtx size, ...@@ -3544,7 +3544,7 @@ emit_push_insn (rtx x, enum machine_mode mode, tree type, rtx size,
int not_stack; int not_stack;
/* # bytes of start of argument /* # bytes of start of argument
that we must make space for but need not store. */ that we must make space for but need not store. */
int offset = partial % (PARM_BOUNDARY / BITS_PER_WORD); int offset = partial % (PARM_BOUNDARY / BITS_PER_UNIT);
int args_offset = INTVAL (args_so_far); int args_offset = INTVAL (args_so_far);
int skip; int skip;
...@@ -3562,8 +3562,9 @@ emit_push_insn (rtx x, enum machine_mode mode, tree type, rtx size, ...@@ -3562,8 +3562,9 @@ emit_push_insn (rtx x, enum machine_mode mode, tree type, rtx size,
offset = 0; offset = 0;
/* Now NOT_STACK gets the number of words that we don't need to /* Now NOT_STACK gets the number of words that we don't need to
allocate on the stack. */ allocate on the stack. Convert OFFSET to words too. */
not_stack = (partial - offset) / UNITS_PER_WORD; not_stack = (partial - offset) / UNITS_PER_WORD;
offset /= UNITS_PER_WORD;
/* If the partial register-part of the arg counts in its stack size, /* If the partial register-part of the arg counts in its stack size,
skip the part of stack space corresponding to the registers. skip the part of stack space corresponding to the registers.
......
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