PR target/20126
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 16 Apr 2005 21:42:26 +0000 (21:42 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 16 Apr 2005 21:42:26 +0000 (21:42 +0000)
* loop.c (loop_givs_rescan): Handle non-replaceable (plus (reg)
(const)).

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

gcc/ChangeLog
gcc/loop.c

index 38556bf..9bba2c5 100644 (file)
@@ -1,5 +1,9 @@
 2005-04-16  Alexandre Oliva  <aoliva@redhat.com>
 
+       PR target/20126
+       * loop.c (loop_givs_rescan): Handle non-replaceable (plus (reg)
+       (const)).
+
        * tree-scalar-evolution.c (interpret_rhs_modify_expr): Fix typo in
        comment.
 
index f432e68..005560a 100644 (file)
@@ -5488,6 +5488,15 @@ loop_givs_rescan (struct loop *loop, struct iv_class *bl, rtx *reg_map)
            loop_insn_emit_before (loop, 0, v->insn,
                                   gen_move_insn (*v->location,
                                                  v->new_reg));
+         else if (GET_CODE (*v->location) == PLUS
+                  && REG_P (XEXP (*v->location, 0))
+                  && CONSTANT_P (XEXP (*v->location, 1)))
+           loop_insn_emit_before (loop, 0, v->insn,
+                                  gen_move_insn (XEXP (*v->location, 0),
+                                                 gen_rtx_MINUS
+                                                 (GET_MODE (*v->location),
+                                                  v->new_reg,
+                                                  XEXP (*v->location, 1))));
          else
            {
              /* If it wasn't a reg, create a pseudo and use that.  */