summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/df-scan.c38
-rw-r--r--gcc/df.h2
-rw-r--r--gcc/rtl.h5
4 files changed, 37 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f9f790027aa..d847d5681ed 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,16 @@
2015-05-19 Richard Sandiford <richard.sandiford@arm.com>
+ * 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 ",".
+
+2015-05-19 Richard Sandiford <richard.sandiford@arm.com>
+
* rtl.h (REG_NREGS): New macro
* alias.c (record_set): Use it.
* cfgcleanup.c (mark_effect): Likewise.
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index db5aa40e255..6175fd9f56b 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -1819,7 +1819,7 @@ df_insn_change_bb (rtx_insn *insn, basic_block new_bb)
static void
df_ref_change_reg_with_loc_1 (struct df_reg_info *old_df,
struct df_reg_info *new_df,
- int new_regno, rtx loc)
+ unsigned int new_regno, rtx loc)
{
df_ref the_ref = old_df->reg_chain;
@@ -1904,25 +1904,33 @@ df_ref_change_reg_with_loc_1 (struct df_reg_info *old_df,
}
-/* Change the regno of all refs that contained LOC from OLD_REGNO to
- NEW_REGNO. Refs that do not match LOC are not changed which means
- that artificial refs are not changed since they have no loc. This
- call is to support the SET_REGNO macro. */
+/* Change the regno of register LOC to NEW_REGNO and update the df
+ information accordingly. Refs that do not match LOC are not changed
+ which means that artificial refs are not changed since they have no loc.
+ This call is to support the SET_REGNO macro. */
void
-df_ref_change_reg_with_loc (int old_regno, int new_regno, rtx loc)
+df_ref_change_reg_with_loc (rtx loc, unsigned int new_regno)
{
- if ((!df) || (old_regno == -1) || (old_regno == new_regno))
+ unsigned int old_regno = REGNO (loc);
+ if (old_regno == new_regno)
return;
- df_grow_reg_info ();
-
- df_ref_change_reg_with_loc_1 (DF_REG_DEF_GET (old_regno),
- DF_REG_DEF_GET (new_regno), new_regno, loc);
- df_ref_change_reg_with_loc_1 (DF_REG_USE_GET (old_regno),
- DF_REG_USE_GET (new_regno), new_regno, loc);
- df_ref_change_reg_with_loc_1 (DF_REG_EQ_USE_GET (old_regno),
- DF_REG_EQ_USE_GET (new_regno), new_regno, loc);
+ if (df)
+ {
+ df_grow_reg_info ();
+
+ df_ref_change_reg_with_loc_1 (DF_REG_DEF_GET (old_regno),
+ DF_REG_DEF_GET (new_regno),
+ new_regno, loc);
+ df_ref_change_reg_with_loc_1 (DF_REG_USE_GET (old_regno),
+ DF_REG_USE_GET (new_regno),
+ new_regno, loc);
+ df_ref_change_reg_with_loc_1 (DF_REG_EQ_USE_GET (old_regno),
+ DF_REG_EQ_USE_GET (new_regno),
+ new_regno, loc);
+ }
+ SET_REGNO_RAW (loc, new_regno);
}
diff --git a/gcc/df.h b/gcc/df.h
index 532a2fdfe55..7e233667fc7 100644
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -1049,7 +1049,7 @@ extern void df_recompute_luids (basic_block);
extern void df_insn_change_bb (rtx_insn *, basic_block);
extern void df_maybe_reorganize_use_refs (enum df_ref_order);
extern void df_maybe_reorganize_def_refs (enum df_ref_order);
-extern void df_ref_change_reg_with_loc (int, int, rtx);
+extern void df_ref_change_reg_with_loc (rtx, unsigned int);
extern void df_notes_rescan (rtx_insn *);
extern void df_hard_reg_init (void);
extern void df_update_entry_block_defs (void);
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 4049d192909..664d3fafad1 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1693,9 +1693,8 @@ inline rtx_insn *JUMP_LABEL_AS_INSN (const rtx_insn *insn)
/* For a REG rtx, REGNO extracts the register number. REGNO can only
be used on RHS. Use SET_REGNO to change the value. */
#define REGNO(RTX) (rhs_regno(RTX))
-#define SET_REGNO(RTX,N) \
- (df_ref_change_reg_with_loc (REGNO (RTX), N, RTX), XCUINT (RTX, 0, REG) = N)
-#define SET_REGNO_RAW(RTX,N) (XCUINT (RTX, 0, REG) = N)
+#define SET_REGNO(RTX, N) (df_ref_change_reg_with_loc (RTX, N))
+#define SET_REGNO_RAW(RTX, N) (XCUINT (RTX, 0, REG) = N)
/* Return the number of consecutive registers in a REG. This is always
1 for pseudo registers and is determined by HARD_REGNO_NREGS for