This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: IA64: roblem with OUTGOING_ARG


On Fri, 2003-11-14 at 10:38, Michael Matz wrote:
> The comment indicates that F_A_R_P expects outgoing reg numbers, but this
> doesn't seem to be the case on ia64.  So, what is wrong: the ia64
> definitions or the use in init_alias_once ?  Or is it the fact that this
> is run with really the final register numbers (after all it's
> machine_depended_reorg)?

flow.c uses FUNCTION_ARG_REGNO_P in regno_uninitialized().  This code
avoids giving a used-before-set warning for registers in
FUNCTION_ARG_REGNO_P.  This only makes sense for incoming registers.

builtins.c uses FUNCTION_ARG_REGNO_P in apply_args_size().  This is used
both for builtin_apply which wants input registers and
builtin_apply_args which wants output registers.  That seems confused. 
But it only counts the size of the registers, and as long as the number
and size of input registers matches the number and size of output
registers, then this will work OK.  That should always be true in
practice.

rtlanal.c uses FUNCTION_ARG_REGNO_P in find_first_parameter_load(). 
This is passed a call insn, so it clearly wants outgoing registers.

combine.c and alias.c both have comments claiming that
FUNCTION_ARG_REGNO_P wants an outgoing register number.

So gcc seems to be confused about the meaning.  In the tm.texi file, the
docs for FUNCTION_ARG_REGNO_P are ambiguous, it doesn't clearly say
whether these are incoming or outgoing registers.

The combine.c comment appeared in Nov 99 with this patch.
	http://gcc.gnu.org/ml/gcc-patches/1999-11n/msg00789.html
This is because the sparc port defines FUNCTION_ARG_REGNO_P to be
outgoing register numbers.

I'll agree that the sparc port is the definitive port for how register
windows work, so that means the ia64 definition is wrong.  It needs to
use AR_ARG_FIRST instead of GR_ARG_FIRST.  I'd also argue that
regno_uninitialized is broken (for targets with register windows), and
that the documentation needs to be fixed to clarify that these are
output registers.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]