The following patch allows shrink-wrapping to succeed in the presence of non-volatile CR save/restore. The movesi_from_cr define_insn used to list all CRs as used, even though it's only the non-volatile values that we are interested in saving/restoring. This prevented the prolog from being moved past the early exit test because that compare was defining a register used in the prolog (a volatile CR). The patch removes the mentions of the volatile CRs and renames the functions involved so that it's hopefully clear they are for prolog generation only. Bootstrap/regtest on powerpc64le-linux with no new regressions. Ok for trunk? -Pat 2017-08-28 Pat Haugen * config/rs6000/rs6000.c (rs6000_emit_prolog_move_from_cr): Rename from rs6000_emit_move_from_cr and call renamed function. (rs6000_emit_prologue): Call renamed functions. * config/rs6000/rs6000.md (prolog_movesi_from_cr): Rename from prolog_movesi_from_cr, remove volatile CRs. testsuite/ChangeLog: 2017-08-28 Pat Haugen * gcc.target/powerpc/cr_shrink-wrap.c: New.