From 16cb56686dba6e45ab5e19b86fbed7712e1e6501 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Thu, 9 Jul 2015 02:50:21 +0000 Subject: [PATCH] always define AUTO_INC_DEC gcc/ChangeLog: 2015-07-08 Trevor Saunders * rtl.h: Always define AUTO_INC_DEC. * auto-inc-dec.c (pass_inc_dec::execute): Adjust. * combine.c (combine_instructions): Likewise. (can_combine_p): Likewise. (try_combine): Likewise. * emit-rtl.c (try_split): Likewise. * loop-invariant.c (calculate_loop_reg_pressure): Likewise. * lower-subreg.c (resolve_simple_move): Likewise. * lra.c (update_inc_notes): Likewise. * recog.c (asm_operand_ok): Likewise. (constrain_operands): Likewise. * regrename.c (scan_rtx_address): Likewise. * reload.c (update_auto_inc_notes): Likewise. (find_equiv_reg): Likewise. * reload1.c (reload): Likewise. (reload_as_needed): Likewise. (choose_reload_regs): Likewise. (emit_input_reload_insns): Likewise. (delete_output_reload): Likewise. * sched-deps.c (init_insn_reg_pressure_info): Likewise. * valtrack.c (cleanup_auto_inc_dec): Likewise. From-SVN: r225595 --- gcc/ChangeLog | 24 ++++++++++++++++++++++++ gcc/auto-inc-dec.c | 6 +++--- gcc/combine.c | 10 +++++----- gcc/emit-rtl.c | 4 ++-- gcc/loop-invariant.c | 2 +- gcc/lower-subreg.c | 4 ++-- gcc/lra.c | 4 ++-- gcc/recog.c | 8 ++++---- gcc/regrename.c | 2 +- gcc/reload.c | 6 +++--- gcc/reload1.c | 18 +++++++++--------- gcc/rtl.h | 6 ++++-- gcc/sched-deps.c | 2 +- gcc/valtrack.c | 2 +- 14 files changed, 62 insertions(+), 36 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 62ca364299d..62d1a9838c5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,27 @@ +2015-07-08 Trevor Saunders + + * rtl.h: Always define AUTO_INC_DEC. + * auto-inc-dec.c (pass_inc_dec::execute): Adjust. + * combine.c (combine_instructions): Likewise. + (can_combine_p): Likewise. + (try_combine): Likewise. + * emit-rtl.c (try_split): Likewise. + * loop-invariant.c (calculate_loop_reg_pressure): Likewise. + * lower-subreg.c (resolve_simple_move): Likewise. + * lra.c (update_inc_notes): Likewise. + * recog.c (asm_operand_ok): Likewise. + (constrain_operands): Likewise. + * regrename.c (scan_rtx_address): Likewise. + * reload.c (update_auto_inc_notes): Likewise. + (find_equiv_reg): Likewise. + * reload1.c (reload): Likewise. + (reload_as_needed): Likewise. + (choose_reload_regs): Likewise. + (emit_input_reload_insns): Likewise. + (delete_output_reload): Likewise. + * sched-deps.c (init_insn_reg_pressure_info): Likewise. + * valtrack.c (cleanup_auto_inc_dec): Likewise. + 2015-07-08 Trevor Saunders * combine.c (can_combine_def_p): Don't check the value of diff --git a/gcc/auto-inc-dec.c b/gcc/auto-inc-dec.c index fdb6243af10..5cab94d036d 100644 --- a/gcc/auto-inc-dec.c +++ b/gcc/auto-inc-dec.c @@ -116,7 +116,7 @@ along with GCC; see the file COPYING3. If not see before the ref or +c if the increment was after the ref, then if we can do the combination but switch the pre/post bit. */ -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC enum form { @@ -1470,7 +1470,7 @@ public: /* opt_pass methods: */ virtual bool gate (function *) { -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC return (optimize > 0 && flag_auto_inc_dec); #else return false; @@ -1485,7 +1485,7 @@ public: unsigned int pass_inc_dec::execute (function *fun ATTRIBUTE_UNUSED) { -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC basic_block bb; int max_reg = max_reg_num (); diff --git a/gcc/combine.c b/gcc/combine.c index 2188926090e..5faa9c86f3b 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -1197,7 +1197,7 @@ combine_instructions (rtx_insn *f, unsigned int nregs) FOR_BB_INSNS (this_basic_block, insn) if (INSN_P (insn) && BLOCK_FOR_INSN (insn)) { -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC rtx links; #endif @@ -1208,7 +1208,7 @@ combine_instructions (rtx_insn *f, unsigned int nregs) insn); record_dead_and_set_regs (insn); -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC for (links = REG_NOTES (insn); links; links = XEXP (links, 1)) if (REG_NOTE_KIND (links) == REG_INC) set_nonzero_bits_and_sign_copies (XEXP (links, 0), NULL_RTX, @@ -1792,7 +1792,7 @@ can_combine_p (rtx_insn *insn, rtx_insn *i3, rtx_insn *pred ATTRIBUTE_UNUSED, const_rtx set = 0; rtx src, dest; rtx_insn *p; -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC rtx link; #endif bool all_adjacent = true; @@ -2073,7 +2073,7 @@ can_combine_p (rtx_insn *insn, rtx_insn *i3, rtx_insn *pred ATTRIBUTE_UNUSED, Also insist that I3 not be a jump; if it were one and the incremented register were spilled, we would lose. */ -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) if (REG_NOTE_KIND (link) == REG_INC && (JUMP_P (i3) @@ -3040,7 +3040,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, || GET_CODE (XEXP (SET_DEST (PATTERN (i3)), 0)) == POST_DEC))) /* It's not the exception. */ #endif -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC { rtx link; for (link = REG_NOTES (i3); link; link = XEXP (link, 1)) diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 200bb74fc9c..1e8825ebb6d 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -3588,7 +3588,7 @@ prev_cc0_setter (rtx_insn *insn) return insn; } -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC /* Find a RTX_AUTOINC class rtx which matches DATA. */ static int @@ -3776,7 +3776,7 @@ try_split (rtx pat, rtx_insn *trial, int last) } break; -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC case REG_INC: for (insn = insn_last; insn != NULL_RTX; insn = PREV_INSN (insn)) { diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c index 8799dacdebe..e1f13865423 100644 --- a/gcc/loop-invariant.c +++ b/gcc/loop-invariant.c @@ -1992,7 +1992,7 @@ calculate_loop_reg_pressure (void) note_stores (PATTERN (insn), mark_reg_store, NULL); -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) if (REG_NOTE_KIND (link) == REG_INC) mark_reg_store (XEXP (link, 0), NULL_RTX, NULL); diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c index 3500c4de715..bedfc73715f 100644 --- a/gcc/lower-subreg.c +++ b/gcc/lower-subreg.c @@ -940,7 +940,7 @@ resolve_simple_move (rtx set, rtx_insn *insn) reg = gen_reg_rtx (orig_mode); -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC { rtx move = emit_move_insn (reg, src); if (MEM_P (src)) @@ -1043,7 +1043,7 @@ resolve_simple_move (rtx set, rtx_insn *insn) mdest = simplify_gen_subreg (orig_mode, dest, GET_MODE (dest), 0); minsn = emit_move_insn (real_dest, mdest); -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC if (MEM_P (real_dest) && !(resolve_reg_p (real_dest) || resolve_subreg_p (real_dest))) { diff --git a/gcc/lra.c b/gcc/lra.c index 793098bd4e4..ce88d8f0e37 100644 --- a/gcc/lra.c +++ b/gcc/lra.c @@ -2088,7 +2088,7 @@ has_nonexceptional_receiver (void) return false; } -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC /* Process recursively X of INSN and add REG_INC notes if necessary. */ static void @@ -2143,7 +2143,7 @@ update_inc_notes (void) else pnote = &XEXP (*pnote, 1); } -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC add_auto_inc_notes (insn, PATTERN (insn)); #endif } diff --git a/gcc/recog.c b/gcc/recog.c index 2a21c66b9b4..3e50fa98790 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -1704,7 +1704,7 @@ int asm_operand_ok (rtx op, const char *constraint, const char **constraints) { int result = 0; -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC bool incdec_ok = false; #endif @@ -1774,7 +1774,7 @@ asm_operand_ok (rtx op, const char *constraint, const char **constraints) result = 1; break; -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC case '<': case '>': /* ??? Before auto-inc-dec, auto inc/dec insns are not supposed @@ -1828,7 +1828,7 @@ asm_operand_ok (rtx op, const char *constraint, const char **constraints) return 0; } -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC /* For operands without < or > constraints reject side-effects. */ if (!incdec_ok && result && MEM_P (op)) switch (GET_CODE (XEXP (op, 0))) @@ -2806,7 +2806,7 @@ constrain_operands (int strict, alternative_mask alternatives) = recog_data.operand[funny_match[funny_match_index].this_op]; } -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC /* For operands without < or > constraints reject side-effects. */ if (recog_data.is_asm) { diff --git a/gcc/regrename.c b/gcc/regrename.c index e5248a54f62..7ad60b6a51a 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -1307,7 +1307,7 @@ scan_rtx_address (rtx_insn *insn, rtx *loc, enum reg_class cl, case PRE_INC: case PRE_DEC: case PRE_MODIFY: -#ifndef AUTO_INC_DEC +#if !AUTO_INC_DEC /* If the target doesn't claim to handle autoinc, this must be something special, like a stack push. Kill this chain. */ action = mark_all_read; diff --git a/gcc/reload.c b/gcc/reload.c index 771f9b46bf3..3b6df378f16 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -5447,7 +5447,7 @@ static void update_auto_inc_notes (rtx_insn *insn ATTRIBUTE_UNUSED, int regno ATTRIBUTE_UNUSED, int reloadnum ATTRIBUTE_UNUSED) { -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC rtx link; for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) @@ -7081,7 +7081,7 @@ find_equiv_reg (rtx goal, rtx_insn *insn, enum reg_class rclass, int other, } } -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC /* If this insn auto-increments or auto-decrements either regno or valueno, return 0 now. If GOAL is a memory ref and its address is not constant, @@ -7168,7 +7168,7 @@ find_inc_amount (rtx x, rtx inced) /* Return 1 if registers from REGNO to ENDREGNO are the subjects of a REG_INC note in insn INSN. REGNO must refer to a hard register. */ -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC static int reg_inc_found_and_valid_p (unsigned int regno, unsigned int endregno, rtx insn) diff --git a/gcc/reload1.c b/gcc/reload1.c index cd607a0d48d..8c3e6e82a43 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -417,7 +417,7 @@ static void delete_output_reload (rtx_insn *, int, int, rtx); static void delete_address_reloads (rtx_insn *, rtx_insn *); static void delete_address_reloads_1 (rtx_insn *, rtx, rtx_insn *); static void inc_for_reload (rtx, rtx, rtx, int); -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC static void add_auto_inc_notes (rtx_insn *, rtx); #endif static void substitute (rtx *, const_rtx, rtx); @@ -1250,7 +1250,7 @@ reload (rtx_insn *first, int global) pnote = &XEXP (*pnote, 1); } -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC add_auto_inc_notes (insn, PATTERN (insn)); #endif @@ -4581,7 +4581,7 @@ static void reload_as_needed (int live_known) { struct insn_chain *chain; -#if defined (AUTO_INC_DEC) +#if AUTO_INC_DEC int i; #endif rtx_note *marker; @@ -4604,7 +4604,7 @@ reload_as_needed (int live_known) rtx_insn *prev = 0; rtx_insn *insn = chain->insn; rtx_insn *old_next = NEXT_INSN (insn); -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC rtx_insn *old_prev = PREV_INSN (insn); #endif @@ -4749,7 +4749,7 @@ reload_as_needed (int live_known) if (NONJUMP_INSN_P (x) && GET_CODE (PATTERN (x)) == CLOBBER) note_stores (PATTERN (x), forget_old_reloads_1, NULL); -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC /* Likewise for regs altered by auto-increment in this insn. REG_INC notes have been changed by reloading: find_reloads_address_1 records substitutions for them, @@ -6606,7 +6606,7 @@ choose_reload_regs (struct insn_chain *chain) } mode = GET_MODE (rld[r].in_reg); } -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC else if (GET_RTX_CLASS (GET_CODE (rld[r].in_reg)) == RTX_AUTOINC && REG_P (XEXP (rld[r].in_reg, 0))) { @@ -7397,7 +7397,7 @@ emit_input_reload_insns (struct insn_chain *chain, struct reload *rl, is ill-formed and we must reject this optimization. */ extract_insn (temp); if (constrain_operands (1, get_enabled_alternatives (temp)) -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC && ! find_reg_note (temp, REG_INC, reloadreg) #endif ) @@ -8870,7 +8870,7 @@ delete_output_reload (rtx_insn *insn, int j, int last_reload_reg, continue; if (MEM_P (reg2) || reload_override_in[k]) reg2 = rld[k].in_reg; -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC if (rld[k].out && ! rld[k].out_reg) reg2 = XEXP (rld[k].in_reg, 0); #endif @@ -9266,7 +9266,7 @@ inc_for_reload (rtx reloadreg, rtx in, rtx value, int inc_amount) } } -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC static void add_auto_inc_notes (rtx_insn *insn, rtx x) { diff --git a/gcc/rtl.h b/gcc/rtl.h index 4b2d85535f5..fe64994f571 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -2518,13 +2518,15 @@ do { \ || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT) \ || defined (HAVE_PRE_MODIFY_DISP) || defined (HAVE_POST_MODIFY_DISP) \ || defined (HAVE_PRE_MODIFY_REG) || defined (HAVE_POST_MODIFY_REG)) -#define AUTO_INC_DEC +#define AUTO_INC_DEC 1 +#else +#define AUTO_INC_DEC 0 #endif /* Define a macro to look for REG_INC notes, but save time on machines where they never exist. */ -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC #define FIND_REG_INC_NOTE(INSN, REG) \ ((REG) != NULL_RTX && REG_P ((REG)) \ ? find_regno_note ((INSN), REG_INC, REGNO (REG)) \ diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index fa4bf5a87bc..d13655a4d9c 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -2222,7 +2222,7 @@ init_insn_reg_pressure_info (rtx_insn *insn) note_stores (PATTERN (insn), mark_insn_reg_store, insn); -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) if (REG_NOTE_KIND (link) == REG_INC) mark_insn_reg_store (XEXP (link, 0), NULL_RTX, insn); diff --git a/gcc/valtrack.c b/gcc/valtrack.c index dca4ffbafb6..67dfd2b4ccc 100644 --- a/gcc/valtrack.c +++ b/gcc/valtrack.c @@ -54,7 +54,7 @@ static rtx cleanup_auto_inc_dec (rtx src, machine_mode mem_mode ATTRIBUTE_UNUSED) { rtx x = src; -#ifdef AUTO_INC_DEC +#if AUTO_INC_DEC const RTX_CODE code = GET_CODE (x); int i; const char *fmt; -- 2.30.2