tilegx.c (tilegx_expand_prologue): Avoid double-decrement of next_scratch_regno.
authorWalter Lee <walt@tilera.com>
Wed, 27 Mar 2013 06:18:49 +0000 (06:18 +0000)
committerWalter Lee <walt@gcc.gnu.org>
Wed, 27 Mar 2013 06:18:49 +0000 (06:18 +0000)
* config/tilegx/tilegx.c (tilegx_expand_prologue): Avoid
double-decrement of next_scratch_regno.

From-SVN: r197139

gcc/ChangeLog
gcc/config/tilegx/tilegx.c

index 919d3d720ab4265161d40681d68d33e424151f37..519cce0de82b39435eee92d0b604d14c4df90e8a 100644 (file)
@@ -1,3 +1,8 @@
+2013-03-27  Walter Lee  <walt@tilera.com>
+
+       * config/tilegx/tilegx.c (tilegx_expand_prologue): Avoid
+       double-decrement of next_scratch_regno.
+
 2013-03-27  Walter Lee  <walt@tilera.com>
 
        * config/tilegx/tilegx.md (insn_v1mulu): Fix constraints on
index 9f2aad5eb38fd9eb1cf8804af610b1bfb6ff32c8..beb1012cf2c636432efe49f6f432e6969f319b69 100644 (file)
@@ -3999,11 +3999,10 @@ tilegx_expand_prologue (void)
 
        if (r == NULL_RTX)
          {
-           rtx p = compute_frame_addr (offset, &next_scratch_regno);
-           r = gen_rtx_REG (Pmode, next_scratch_regno--);
-           reg_save_addr[which_scratch] = r;
-
-           emit_insn (gen_rtx_SET (VOIDmode, r, p));
+           int prev_scratch_regno = next_scratch_regno;
+           r = compute_frame_addr (offset, &next_scratch_regno);
+           if (prev_scratch_regno != next_scratch_regno)
+             reg_save_addr[which_scratch] = r;
          }
        else
          {