------- Comment #11 from vmakarov at redhat dot com 2008-09-08 14:11 ------- Eric, thanks a lot for your analysis. It was very helpful. I've reproduced the bug.
IRA uses live ranges to find conflicts for spill slots during reload. Live ranges for r376 were wrong after IR flattening. We have the following loop structure for the case l8->l7->l0 ^ l24->l22-| and we remove mem<-reg coping allocno values from l8 to l0 because allocnos corresponding to r376 are not modified in the loops. Allocno for r376 in l0 got live ranges only from l8 and l7 but not from l22 ... Therefore IRA does not find conflicts with another allocno (r90) in l22 and l24. I'll send a patch to solve the problem today. Just removing the optimization (removing unnecessary mem<-reg) is not wise because it has significant impact on the generated code performance. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37377