On 05/18/2015 12:15 PM, Richard Sandiford wrote:
This patch cleans up the interface to df_ref_change_reg_with_loc.
The function is used only by SET_REGNO_RAW, so the old regno is
always REGNO (x) and the caller always goes on to set REGNO.
(And the fuction doesn't make much sense otherwise.)

The patch therefore gets df_ref_change_reg_with_loc to work out the old
regno itself and to install the new register number once it's done.

The check for the old register being -1 was redundant.  Only expr.c
and postreload.c create -1 registers ("fixed" in a later patch).
Both sites are just creating temporary registers in order to query
backend hooks and neither site needs the check.  expr.c does use
SET_REGNO and so does go through this function, but only at a time
when there's no df information.  (And it wouldn't work if the df
machinery were set up, since any change after the first would
look like a "normal" change.)  postreload.c uses SET_REGNO_RAW
and so bypasses the code altogether.

expr.c bypasses the code too by the end of the series.


gcc/
        * df.h (df_ref_change_reg_with_loc): Remove old_regno parameter.
        Change type of new_regno to unsigned int.
        * df-scan.c (df_ref_change_reg_with_loc_1): Change type of
        new_regno to unsigned int.
        (df_ref_change_reg_with_loc): Remove old_regno parameter.
        Change type of new_regno to unsigned int.  Use SET_REGNO_RAW.
        * rtl.h (SET_REGNO): Update call to df_ref_change_reg_with_loc.
        (SET_REGNO_RAW): Add space after ",".
OK.
jeff

Reply via email to