------- Comment #6 from krebbel1 at de dot ibm dot com 2005-11-04 07:56 ------- My patch introduced the s390_regs_ever_clobbered function which is used instead of regs_ever_live for determining which registers need saving in function prologue. This function is called during reload when the elimination offsets of eliminable registers are calculated. Whithin the first phase of reload where the reloads only are recorded in struct reloads without modifying the insn itself the back end function only sees the registers assigned by global alloc. Whenever a call clobbered register assigned by global alloc is changed to a call saved register by reload the back end can not see this change in the first phase of reload but afterwards when the changes are applied to the insn. Hence the elimination offset for the arg pointer can change what causes the ICE.
Using regs_ever_live is safe even in this first reload phase because that array is updated when reload information is recorded in spill_hard_reg. I've tried a back end hack in s390_regs_ever_clobbered walking through the reload_insn_chain if reload_in_progress is set. For all reload structs I've marked the used reload regs in my regs_ever_clobbered array. But this is probably wrong because reload is not bound to the decisions made in the first phase. It is only assured that the regs in used_spill_regs are sufficient for covering all spill decisions which will be made later on. So the better choice should be to look into the used_spill_regs array which unfortunately is set up after verify_initial_elim_offsets is called (in select_reload_regs). For now I don't see how this can be fixed easily. I will discuss the issue with Ulrich. If we aren't able to come up with a solution I will revert my patch :( -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24624