This is the mail archive of the gcc-patches@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: Unrepresentable subregs and hard_regno_nregs


"Joseph S. Myers" <joseph@codesourcery.com> writes:

> Comments?  OK to commit?  Should the various places I made call 
> subreg_nregs be further revised to call subreg_get_info directly, rather 
> than first calling subreg_regno{,_offset} and then subreg_nregs, or should 
> that be done in a separate patch?  (The same cleanup to avoid duplicate 
> work would also apply to existing places that call 
> subreg_offset_representable_p before calling one of the other functions.)

This can be done as a separate patch.

> @@ -6479,6 +6479,10 @@
>  				      GET_MODE (SUBREG_REG (x)),
>  				      SUBREG_BYTE (x),
>  				      GET_MODE (x));
> +      endregno = regno + (regno < FIRST_PSEUDO_REGISTER
> +			  ? subreg_nregs (x) : 1);
> +
> +      return refers_to_regno_for_reload_p (regno, endregno, in, (rtx*) 0);
>      }
>    else if (REG_P (x))
>      {

This leaves some code at the end of the function which is only used in
the REG_P case.  Please pull it up into the REG_P case and put a
gcc_unreachable () at the end of the function.

> -	      regno_last = (regno_first
> -			    + hard_regno_nregs[regno_first][outer_mode] - 1);
> +	      regno_last = (regno_first + subreg_nregs (reg) - 1);

Please remove the parentheses which are no longer needed.

The patch is OK with those changes.

Thanks.

Ian


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