OSDN Git Service

(find_splittable_givs): For rewritting illegal init
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Dec 1993 19:21:01 +0000 (19:21 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Dec 1993 19:21:01 +0000 (19:21 +0000)
insn, use force_operand instead of emit_iv_add_mult.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@6267 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/unroll.c

index e3ed103..eac1e95 100644 (file)
@@ -2669,9 +2669,22 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment,
                                    loop_start);
                  if (recog_memoized (PREV_INSN (loop_start)) < 0)
                    {
+                     rtx sequence, ret;
+
+                     /* We can't use bl->initial_value to compute the initial
+                        value, because the loop may have been preconditioned.
+                        We must calculate it from NEW_REG.  Try using
+                        force_operand instead of emit_iv_add_mult.  */
                      delete_insn (PREV_INSN (loop_start));
-                     emit_iv_add_mult (bl->initial_value, v->mult_val,
-                                       v->add_val, tem, loop_start);
+
+                     start_sequence ();
+                     ret = force_operand (v->new_reg, tem);
+                     if (ret != tem)
+                       emit_move_insn (tem, ret);
+                     sequence = gen_sequence ();
+                     end_sequence ();
+                     emit_insn_before (sequence, loop_start);
+
                      if (loop_dump_stream)
                        fprintf (loop_dump_stream,
                                 "Illegal init insn, rewritten.\n");