From: Walter Lee Date: Wed, 27 Mar 2013 06:39:01 +0000 (+0000) Subject: backport: tilegx.c (tilegx_expand_prologue): Avoid double-decrement of next_scratch_r... X-Git-Tag: releases/gcc-4.7.3~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db09787722c0bc899d80f983743e71c66767209b;p=thirdparty%2Fgcc.git backport: tilegx.c (tilegx_expand_prologue): Avoid double-decrement of next_scratch_regno. Backport from mainline: 2013-03-27 Walter Lee * config/tilegx/tilegx.c (tilegx_expand_prologue): Avoid double-decrement of next_scratch_regno. From-SVN: r197149 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 21f63415abac..405b6a7043d8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2013-03-27 Walter Lee + + Backport from mainline: + 2013-03-27 Walter Lee + + * config/tilegx/tilegx.c (tilegx_expand_prologue): Avoid + double-decrement of next_scratch_regno. + 2013-03-27 Walter Lee Backport from mainline: diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c index 3add23c0fa60..81e015d49bc5 100644 --- a/gcc/config/tilegx/tilegx.c +++ b/gcc/config/tilegx/tilegx.c @@ -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 {