From: Trevor Saunders <tbsaunde+...@tbsaunde.org>

gcc/ChangeLog:

2015-07-06  Trevor Saunders  <tbsaunde+...@tbsaunde.org>

        * 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.
---
 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 +-
 13 files changed, 38 insertions(+), 36 deletions(-)

diff --git a/gcc/auto-inc-dec.c b/gcc/auto-inc-dec.c
index df52229..dd183ee 100644
--- a/gcc/auto-inc-dec.c
+++ b/gcc/auto-inc-dec.c
@@ -123,7 +123,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
 {
@@ -1477,7 +1477,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;
@@ -1492,7 +1492,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 da5c335..346bdff 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1204,7 +1204,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
 
@@ -1215,7 +1215,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,
@@ -1798,7 +1798,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;
@@ -2079,7 +2079,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)
@@ -3045,7 +3045,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 80c0adb..eb44066 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -3594,7 +3594,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
@@ -3782,7 +3782,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 d3a7439..1285c66 100644
--- a/gcc/loop-invariant.c
+++ b/gcc/loop-invariant.c
@@ -1998,7 +1998,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 bacb65f..a57ce43 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -948,7 +948,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))
@@ -1051,7 +1051,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 bdd8e3c..0bf822f 100644
--- a/gcc/lra.c
+++ b/gcc/lra.c
@@ -2093,7 +2093,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
@@ -2148,7 +2148,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 3fbfe07..2e8be6a 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -1720,7 +1720,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
 
@@ -1790,7 +1790,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
@@ -1844,7 +1844,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)))
@@ -2822,7 +2822,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 2e08669..0fce77e 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -1312,7 +1312,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 4bc996f..3323816 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -5454,7 +5454,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))
@@ -7088,7 +7088,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,
@@ -7175,7 +7175,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 57837a1..f05596f 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -424,7 +424,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);
@@ -1257,7 +1257,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
 
@@ -4585,7 +4585,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;
@@ -4608,7 +4608,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
 
@@ -4753,7 +4753,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,
@@ -6610,7 +6610,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)))
                {
@@ -7401,7 +7401,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
              )
@@ -8874,7 +8874,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
@@ -9270,7 +9270,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 d74c20f..3b9546a 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2555,13 +2555,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 b62dc00..a2ab8e5 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -2228,7 +2228,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 80a0043..8646a63 100644
--- a/gcc/valtrack.c
+++ b/gcc/valtrack.c
@@ -57,7 +57,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.4.0

Reply via email to