This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Reload bug
> > The function appears to assume that reg XREGNO supports mode YMODE. Is
> > that by design? If so, I think you should mention it in the header
> > comment.
>
> Hmm, I am not certain what should happen there. We can either verify it
> here or the place we are doing so already...
I think we should verify that the subreg is really representable. For low
parts, it's HARD_REGNO_MODE_OK (xregno, ymode) == 1. Are you sure that we
should not verify that HARD_REGNO_MODE_OK (xregno + offset, ymode) == 1
at the very end of the function either, like in the original code?
> > I think you should mention that the second "if" catches paradoxical
> > subregs too.
>
> Hmm, you are right. Then we can remove the first if too :)
Even for big-endian platforms? I think the first "if" in the original code
catches paradoxical subregs on big-endian platforms and the second "if"
catches them on little-endian platforms.
> No, I am actually trying to compute the size of the one ymode register
> in order to be able to compensate the lowpart operation.
> Imagine (subreg:QI (reg:DI) 3) is valid on little endian with
> nregs_ymode == 2
I presume you mean big-endian? And nregs_xmode == 2?
Then wouldn't the following formula be better?
offset -= subreg_lowpart_offset (mode_for_size (GET_MODE_SIZE (ymode)
/ nregs_ymode, MODE_INT, 0),
mode_for_size (GET_MODE_SIZE (xmode)
/ nregs_xmode, MODE_INT, 0));
It looks certainly more homogeneous than the former.
--
Eric Botcazou