This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: MIPS problem with structures/varargs
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: MIPS problem with structures/varargs
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Fri, 03 Sep 1999 18:00:57 -0600
- cc: gavin at cygnus dot com, gcc-bugs at gcc dot gnu dot org, wilson at cygnus dot com
- Reply-To: law at cygnus dot com
In message <19990903165218I.mitchell@codesourcery.com>you write:
> I'm still unclear on one thing: is the fix split between the
> middle-end and the back-end, or all in the back-end? I understand
> what you wrote; I'm unclear on whether or not doing something similar
> in the MIPS backend is possible, without waiting for some
> machine-independent part of the PA stuff to hit the tree.
There's generic code in the front-end (already in the tree) that is activiated
by function_arg returning that ugly expr_list/parallel thingie. For the
machine independent code look for emit_group_load or something like that.
The current PA code looks something like this:
/* If the argument is more than a word long, then we need to align
the base registers. Same caveats as above. */
if (FUNCTION_ARG_SIZE (mode, type) > 1)
{
if (mode != BLKmode)
{
/* This seems backwards, but it is what HP specifies. We need
gpr_reg_base to point to the smaller numbered register of
the integer register pair. So if we have an even register
number, then decrement the gpr base. */
gpr_reg_base -= ((gpr_reg_base % 2) == 0);
/* FP values behave sanely, except that each FP reg is only
half of word. */
fpr_reg_base += ((fpr_reg_base % 4) == 2) * 2;
}
else
{
rtx loc[8];
int i, offset = 0, ub;
ub = FUNCTION_ARG_SIZE (mode, type);
ub = MIN(ub,
MAX(0, max_arg_words - cum->words - (cum->words & 1)));
gpr_reg_base -= (cum->words & 1);
for (i = 0; i < ub; i++)
{
loc[i] = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_REG (DImode,
gpr_reg_base),
GEN_INT(offset));
gpr_reg_base -= 1;
offset += 8;
}
if (ub == 0)
return NULL_RTX;
else if (ub == 1)
return XEXP (loc[0], 0);
else
return gen_rtx_PARALLEL(mode, gen_rtvec_v(ub, loc));
}
The key is that weird PARALLEL/EXPR_LIST stuff. Hopefully I have a little time
to wrap my brain around this stuff soon since it can be used to fix a long
standing bug in the PA32 support.
jeff