2003-07-08 James E Wilson * loop.c (loop_iv_add_mult_emit_before): Call loop_regs_update before loop_insn_emit_before. (loop_iv_add_mult_sink, loop_iv_add_mult_hoist): Likewise. Index: loop.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/loop.c,v retrieving revision 1.462 diff -p -r1.462 loop.c *** loop.c 6 Jul 2003 09:56:04 -0000 1.462 --- loop.c 9 Jul 2003 01:21:25 -0000 *************** loop_iv_add_mult_emit_before (const stru *** 7737,7747 **** update_reg_last_use (b, before_insn); update_reg_last_use (m, before_insn); - loop_insn_emit_before (loop, before_bb, before_insn, seq); - /* It is possible that the expansion created lots of new registers. ! Iterate over the sequence we just created and record them all. */ loop_regs_update (loop, seq); } --- 7737,7748 ---- update_reg_last_use (b, before_insn); update_reg_last_use (m, before_insn); /* It is possible that the expansion created lots of new registers. ! Iterate over the sequence we just created and record them all. We ! must do this before inserting the sequence. */ loop_regs_update (loop, seq); + + loop_insn_emit_before (loop, before_bb, before_insn, seq); } *************** loop_iv_add_mult_sink (const struct loop *** 7764,7774 **** update_reg_last_use (b, loop->sink); update_reg_last_use (m, loop->sink); - loop_insn_sink (loop, seq); - /* It is possible that the expansion created lots of new registers. ! Iterate over the sequence we just created and record them all. */ loop_regs_update (loop, seq); } --- 7765,7776 ---- update_reg_last_use (b, loop->sink); update_reg_last_use (m, loop->sink); /* It is possible that the expansion created lots of new registers. ! Iterate over the sequence we just created and record them all. We ! must do this before inserting the sequence. */ loop_regs_update (loop, seq); + + loop_insn_sink (loop, seq); } *************** loop_iv_add_mult_hoist (const struct loo *** 7784,7794 **** /* Use copy_rtx to prevent unexpected sharing of these rtx. */ seq = gen_add_mult (copy_rtx (b), copy_rtx (m), copy_rtx (a), reg); - loop_insn_hoist (loop, seq); - /* It is possible that the expansion created lots of new registers. ! Iterate over the sequence we just created and record them all. */ loop_regs_update (loop, seq); } --- 7786,7797 ---- /* Use copy_rtx to prevent unexpected sharing of these rtx. */ seq = gen_add_mult (copy_rtx (b), copy_rtx (m), copy_rtx (a), reg); /* It is possible that the expansion created lots of new registers. ! Iterate over the sequence we just created and record them all. We ! must do this before inserting the sequence. */ loop_regs_update (loop, seq); + + loop_insn_hoist (loop, seq); }