On 05/18/2015 12:23 PM, Richard Sandiford wrote:
This patch adds a new function to set both the mode and regno of a REG. It makes sure that all REG PUT_MODE and SET_REGNO changes go through this function. There's a new PUT_MODE_RAW (analogous to SET_REGNO_RAW) for the cases where the caller doesn't want that.There's a small consistency fix: gen_rtx_REG was declared with "unsigned" and defined with "unsigned int". The latter is usual GCC style. gcc/ * rtl.h (PUT_MODE_RAW): New macro. (PUT_REG_NOTE_KIND): Use it. (set_mode_and_regno): Declare. (gen_raw_REG): Change regno to "unsigned int". (gen_rtx_REG): Change "unsigned" to "unsigned int". (PUT_MODE): Forward to PUT_MODE_RAW for generators, otherwise use set_mode_and_regno to change the mode of registers. * gengenrtl.c (gendef): Use PUT_MODE_RAW. * emit-rtl.c (set_mode_and_regno): New function. (gen_raw_REG): Change regno to unsigned int. Use set_mode_and_regno. * caller-save.c (reg_save_code): Use set_mode_and_regno. * expr.c (init_expr_target): Likewise. * ira.c (setup_prohibited_mode_move_regs): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise.
OK. jeff
