Message ID | 856cc263-f65c-73fc-ba05-779e80e27f2e@codesourcery.com |
---|---|
State | New |
Headers | show |
On 04/01/2017 10:48 AM, Andrew Jenner wrote: > In the course of working with the ia16 port, I found a case of subreg > shape (I think it was a 32-bit value in one 16-bit register and two > 8-bit registers) which is not currently supported by subreg_get_info but > which easily could be, with the attached change. > > 2017-04-01 Andrew Jenner <andrew@codesourcery.com> > > * rtlanal.c (subreg_get_info): set info->nregs from hard_regno_nregs. > I really think we need a testcase for this. Or at least a very clear description of the situation. ie, what is xregno, xmode & ymode. It's probably also useful to indicate what hard_regno_nregs is for the given xregno and ymode. jeff
Index: gcc/rtlanal.c =================================================================== --- gcc/rtlanal.c (revision 475331) +++ gcc/rtlanal.c (revision 475455) @@ -3730,7 +3730,7 @@ subreg_get_info (unsigned int xregno, ma rknown = true; } info->offset = (y_offset / (mode_multiple / nregs_multiple)) * nregs_ymode; - info->nregs = nregs_ymode; + info->nregs = hard_regno_nregs[xregno + info->offset][ymode]; } /* This function returns the regno offset of a subreg expression.