In this testcase shrink-wrap makes a not-so-great decision. Both regcprop and regrename cannot handle the resulting RTL correctly. The first two patches fix those passes.
The third patch makes separate shrink-wrapping do a better job: running spread_components more than once should help only in unusual cases, but it turns out those unusual cases happen a lot. The last patch makes the rs6000 backend generate REG_CFA_REGISTER notes always with an argument (instead of having it nil, which means use the pattern of the instruction). This makes live easier for anything that needs to handle those notes, and nil should probably be disallowed. Segher Boessenkool (4): regcprop: Avoid REG_CFA_REGISTER notes (PR85645) regrename: Don't rename the dest of a REG_CFA_REGISTER (PR85645) shrink-wrap: Improve spread_components (PR85645) rs6000: Give an argument to every REG_CFA_REGISTER (PR85645) gcc/config/rs6000/rs6000.c | 6 +++--- gcc/regcprop.c | 6 ++++++ gcc/regrename.c | 19 +++++++++++++++---- gcc/shrink-wrap.c | 23 ++++++++++++++++++++--- 4 files changed, 44 insertions(+), 10 deletions(-) -- 1.8.3.1