]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: tilegx.c (tilegx_expand_prologue): Avoid double-decrement of next_scratch_r...
authorWalter Lee <walt@tilera.com>
Wed, 27 Mar 2013 06:39:01 +0000 (06:39 +0000)
committerWalter Lee <walt@gcc.gnu.org>
Wed, 27 Mar 2013 06:39:01 +0000 (06:39 +0000)
Backport from mainline:
2013-03-27  Walter Lee  <walt@tilera.com>

* config/tilegx/tilegx.c (tilegx_expand_prologue): Avoid
double-decrement of next_scratch_regno.

From-SVN: r197149

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

index 21f63415abac7b6099e403aec85fa504704d6069..405b6a7043d88256472fcdac8e5c114305751314 100644 (file)
@@ -1,3 +1,11 @@
+2013-03-27  Walter Lee  <walt@tilera.com>
+
+       Backport from mainline:
+       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>
 
        Backport from mainline:
index 3add23c0fa60f2e009681feca4381800c4a1abaf..81e015d49bc5f1ad8defc59c21e3b08cd1e83089 100644 (file)
@@ -3948,11 +3948,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
          {