re PR target/20126 (Inlined memcmp makes one argument null on entry)
authorAlexandre Oliva <aoliva@redhat.com>
Sat, 16 Apr 2005 21:42:26 +0000 (21:42 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Sat, 16 Apr 2005 21:42:26 +0000 (21:42 +0000)
PR target/20126
* loop.c (loop_givs_rescan): Handle non-replaceable (plus (reg)
(const)).

From-SVN: r98238

gcc/ChangeLog
gcc/loop.c

index 38556bf32714f038a2acb4f1c643e38b1b5b22eb..9bba2c5a584ccac79f496a53e145806d8457ac83 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 f432e68e5927d04b7529f0f7033a1cac79977168..005560a361713447615985ab00d98d92e7659ccb 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.  */