+2015-07-08 Trevor Saunders <tbsaunde+gcc@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.
+
2015-07-08 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* combine.c (can_combine_def_p): Don't check the value of
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
{
/* 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;
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 ();
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
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,
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;
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)
|| 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))
return insn;
}
-#ifdef AUTO_INC_DEC
+#if AUTO_INC_DEC
/* Find a RTX_AUTOINC class rtx which matches DATA. */
static int
}
break;
-#ifdef AUTO_INC_DEC
+#if AUTO_INC_DEC
case REG_INC:
for (insn = insn_last; insn != NULL_RTX; insn = PREV_INSN (insn))
{
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);
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))
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)))
{
return false;
}
-#ifdef AUTO_INC_DEC
+#if AUTO_INC_DEC
/* Process recursively X of INSN and add REG_INC notes if necessary. */
static void
else
pnote = &XEXP (*pnote, 1);
}
-#ifdef AUTO_INC_DEC
+#if AUTO_INC_DEC
add_auto_inc_notes (insn, PATTERN (insn));
#endif
}
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
result = 1;
break;
-#ifdef AUTO_INC_DEC
+#if AUTO_INC_DEC
case '<':
case '>':
/* ??? Before auto-inc-dec, auto inc/dec insns are not supposed
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)))
= 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)
{
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;
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))
}
}
-#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,
/* 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)
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);
pnote = &XEXP (*pnote, 1);
}
-#ifdef AUTO_INC_DEC
+#if AUTO_INC_DEC
add_auto_inc_notes (insn, PATTERN (insn));
#endif
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;
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
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,
}
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)))
{
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
)
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
}
}
\f
-#ifdef AUTO_INC_DEC
+#if AUTO_INC_DEC
static void
add_auto_inc_notes (rtx_insn *insn, rtx x)
{
|| 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)) \
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);
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;