diff mbox

[8/9] subreg_get_info

Message ID 856cc263-f65c-73fc-ba05-779e80e27f2e@codesourcery.com
State New
Headers show

Commit Message

Andrew Jenner April 1, 2017, 4:48 p.m. UTC
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.

Comments

Jeff Law April 25, 2017, 4:39 p.m. UTC | #1
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
diff mbox

Patch

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.