Dear all, I've been working on renaming registers using the DF framework but am wondering if I'm doing things correctly. This is done in the REORG pass because I need to ensure that I have consecutive registers for loads in order to get a load multiple generated.
Basically, the beginning of the code tries to find free registers and tries to rename some to get some place. Say I want to rename register SRC to DEST throughout the whole function. I do this : For each instruction in each basic block: Look into the DF_INSN_UID_USES / DF_INSN_UID_EQ_USES / DF_INSN_UID_DEFS For each reference, check if DF_REF_REGNO is equal to SRC call replace_ref from the web.c code which looks like this in my case: { rtx oldreg = DF_REF_REAL_REG (ref); rtx *loc = DF_REF_REAL_LOC (ref); unsigned int uid = INSN_UID (DF_REF_INSN (ref)); rtx reg; /* Paranoid */ if (REGNO (oldreg) == repl) return; reg = findReplacement (oldreg, repl); fprintf (stderr, "Updating insn %i (%i->%i)\n", uid, REGNO (oldreg), REGNO (reg)); *loc = reg; df_insn_rescan (DF_REF_INSN (ref)); } But it segfaults after a while on the DF_REF_REAL_LOC call. I don't know why. Any ideas ? I also call df_analyze and df_finish_pass (false) at each reorg call. Thanks for your help, Jc