2013-10-11 Cesar Philippidis gcc/ * regs.h (REG_N_GROW): New function. * combine.c (combine_split_insns): Call REG_N_GROW when new registers are created. Index: gcc/regs.h =================================================================== --- gcc/regs.h (revision 203289) +++ gcc/regs.h (working copy) @@ -89,6 +89,20 @@ REG_N_SETS (int regno) #define SET_REG_N_SETS(N,V) (regstat_n_sets_and_refs[N].sets = V) #define INC_REG_N_SETS(N,V) (regstat_n_sets_and_refs[N].sets += V) +/* Indexed by n, inserts new registers (old_regno+1)..new_regno. */ +static inline void +REG_N_GROW (int new_regno, int old_regno) +{ + regstat_n_sets_and_refs = XRESIZEVEC (struct regstat_n_sets_and_refs_t, + regstat_n_sets_and_refs, new_regno+1); + + for (int i = old_regno + 1; i <= new_regno; ++i) + { + SET_REG_N_SETS (i, 1); + SET_REG_N_REFS (i, 1); + } +} + /* Given a REG, return TRUE if the reg is a PARM_DECL, FALSE otherwise. */ extern bool reg_is_parm_p (rtx); Index: gcc/combine.c =================================================================== --- gcc/combine.c (revision 203289) +++ gcc/combine.c (working copy) @@ -518,7 +518,10 @@ combine_split_insns (rtx pattern, rtx insn) ret = split_insns (pattern, insn); nregs = max_reg_num (); if (nregs > reg_stat.length ()) - reg_stat.safe_grow_cleared (nregs); + { + REG_N_GROW (nregs, reg_stat.length ()); + reg_stat.safe_grow_cleared (nregs); + } return ret; }