diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2004-02-14 14:43:21 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2004-02-14 14:43:21 +0000 |
commit | 45f9877a5168dab9c83c1b486c09d18f0a26291f (patch) | |
tree | 36aea4c894ba608bfe3c5b77f9b4f4e893970a25 /gcc/loop.c | |
parent | 544142d816f321328d392eac4ddec58c5348de40 (diff) | |
download | gcc-45f9877a5168dab9c83c1b486c09d18f0a26291f.zip gcc-45f9877a5168dab9c83c1b486c09d18f0a26291f.tar.gz gcc-45f9877a5168dab9c83c1b486c09d18f0a26291f.tar.bz2 |
loop.c (check_dbra_loop): Use gen_int_mode instead of GEN_INT for start_value when...
* loop.c (check_dbra_loop): Use gen_int_mode instead of GEN_INT
for start_value when it is directly moved into reg, and factorize
the retrieval of GET_MODE (reg).
From-SVN: r77803
Diffstat (limited to 'gcc/loop.c')
-rw-r--r-- | gcc/loop.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -8015,6 +8015,7 @@ check_dbra_loop (struct loop *loop, int insn_count) struct loop_ivs *ivs = LOOP_IVS (loop); struct iv_class *bl; rtx reg; + enum machine_mode mode; rtx jump_label; rtx final_value; rtx start_value; @@ -8435,6 +8436,7 @@ check_dbra_loop (struct loop *loop, int insn_count) /* Save some info needed to produce the new insns. */ reg = bl->biv->dest_reg; + mode = GET_MODE (reg); jump_label = condjump_label (PREV_INSN (loop_end)); new_add_val = GEN_INT (-INTVAL (bl->biv->add_val)); @@ -8446,12 +8448,12 @@ check_dbra_loop (struct loop *loop, int insn_count) if (initial_value == const0_rtx && GET_CODE (comparison_value) == CONST_INT) { - start_value = GEN_INT (comparison_val - add_adjust); + start_value + = gen_int_mode (comparison_val - add_adjust, mode); loop_insn_hoist (loop, gen_move_insn (reg, start_value)); } else if (GET_CODE (initial_value) == CONST_INT) { - enum machine_mode mode = GET_MODE (reg); rtx offset = GEN_INT (-INTVAL (initial_value) - add_adjust); rtx add_insn = gen_add3_insn (reg, comparison_value, offset); @@ -8467,7 +8469,6 @@ check_dbra_loop (struct loop *loop, int insn_count) } else if (! add_adjust) { - enum machine_mode mode = GET_MODE (reg); rtx sub_insn = gen_sub3_insn (reg, comparison_value, initial_value); @@ -8525,7 +8526,7 @@ check_dbra_loop (struct loop *loop, int insn_count) /* Add new compare/branch insn at end of loop. */ start_sequence (); emit_cmp_and_jump_insns (reg, const0_rtx, cmp_code, NULL_RTX, - GET_MODE (reg), 0, + mode, 0, XEXP (jump_label, 0)); tem = get_insns (); end_sequence (); |