aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter Lee <walt@tilera.com>2013-03-27 06:18:49 +0000
committerWalter Lee <walt@gcc.gnu.org>2013-03-27 06:18:49 +0000
commit0a514f47b835740bc283e61541883a2793d4af1f (patch)
treee17b7f516a2fdcbd6562e1e3f5e4c4e6c6fb2f31
parent9332b0d294bb48fa556aebc6c3eba1841f848b8a (diff)
downloadgcc-0a514f47b835740bc283e61541883a2793d4af1f.zip
gcc-0a514f47b835740bc283e61541883a2793d4af1f.tar.gz
gcc-0a514f47b835740bc283e61541883a2793d4af1f.tar.bz2
tilegx.c (tilegx_expand_prologue): Avoid double-decrement of next_scratch_regno.
* config/tilegx/tilegx.c (tilegx_expand_prologue): Avoid double-decrement of next_scratch_regno. From-SVN: r197139
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/tilegx/tilegx.c9
2 files changed, 9 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 919d3d72..519cce0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
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
input operands.
(insn_v1mulus): Ditto.
diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c
index 9f2aad5..beb1012 100644
--- a/gcc/config/tilegx/tilegx.c
+++ b/gcc/config/tilegx/tilegx.c
@@ -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
{