This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bugs in MIPS FUNCTION_ARG_REGNO_P ?
Ah ha, it was me and somehow my comment on why was deleted:
/* 1 if N is a possible register number for function argument passing.
We have no FP argument registers when soft-float. When FP registers
are 32 bits, we can't directly reference the odd numbered ones. */
+/* For o64 we should be checking the mode for SFmode as well. */
#define FUNCTION_ARG_REGNO_P(N)
\
((((N) >= GP_ARG_FIRST && (N) <= GP_ARG_LAST)
\
- || ((N) >= FP_ARG_FIRST && (N) <= FP_ARG_LAST)) \
- && !fixed_regs[N])
+ || ((N) >= FP_ARG_FIRST && (N) <= FP_ARG_LAST \
+ && (((N) % FP_INC) == 0 \
+ && (! mips_abi == ABI_O64))) \
+ && !fixed_regs[N]))
Basically I believe I turned it off in occasions when it wouldn't work,
though perhaps not in the best way. So, obviously something is wrong,
but I remember an argument passing bug here with SFmode arguments at one
point that was fixed with this - though at the moment I'm drawing a
blank. More detailed comments next time :)
-eric
On Tue, 2004-03-02 at 23:25, Mark Mitchell wrote:
> Eric Christopher wrote:
>
> > On Tue, 2004-03-02 at 19:05, Mark Mitchell wrote:
> >
> >>Eric --
> >>
> >>If I read this correctly:
> >>
> >>#define FUNCTION_ARG_REGNO_P(N) \
> >> ((IN_RANGE((N), GP_ARG_FIRST, GP_ARG_LAST) \
> >> || (IN_RANGE((N), FP_ARG_FIRST, FP_ARG_LAST) \
> >> && ((N) % FP_INC == 0) && mips_abi != ABI_O64)) \
> >> && !fixed_regs[N])
> >>
> >>it says that floating-point registers are never used for
> >>argument-passing in the O64 ABI. That doesn't seem right.
> >
> >
> > It's been that way for quite some time. I believe it to be correct,
> > however, Jim would know best if he remembers.
>
> What exactly do you believe to be correct? The macro implementation, or
> the statement that the O64 ABI does not use floating-point registers for
> arugment-passing?
>
> The latter statement does not match what the rest of the compiler does
> -- compiling test programs with -mabi=o64 shows that $f12, $f13, $f14
> are are used for floating-point arguments, and there are comments to
> that effect in the code.
>
> So, I guess you believe the macro to be correct? I'm confused as to how
> that could be, since it seems never to return true for a floating-point
> register when using the O64 ABI.
>
> Well, perhaps Jim can shed some lite, as you say.
>
> Thanks for looking at it!
--
Eric Christopher <echristo@redhat.com>