aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c70
1 files changed, 17 insertions, 53 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index c88f928..4c55ca5 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -262,8 +262,8 @@ static bool alternative_allows_const_pool_ref (rtx, const char *, int);
static rtx find_reloads_toplev (rtx, int, enum reload_type, int, int,
rtx_insn *, int *);
static rtx make_memloc (rtx, int);
-static int maybe_memory_address_addr_space_p (machine_mode, rtx,
- addr_space_t, rtx *);
+static bool maybe_memory_address_addr_space_p (machine_mode, rtx,
+ addr_space_t, rtx *);
static int find_reloads_address (machine_mode, rtx *, rtx, rtx *,
int, enum reload_type, int, rtx_insn *);
static rtx subst_reg_equivs (rtx, rtx_insn *);
@@ -1500,27 +1500,6 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc,
if (in != 0 && in != *inloc)
rld[i].nocombine = 1;
-#if 0
- /* This was replaced by changes in find_reloads_address_1 and the new
- function inc_for_reload, which go with a new meaning of reload_inc. */
-
- /* If this is an IN/OUT reload in an insn that sets the CC,
- it must be for an autoincrement. It doesn't work to store
- the incremented value after the insn because that would clobber the CC.
- So we must do the increment of the value reloaded from,
- increment it, store it back, then decrement again. */
- if (out != 0 && sets_cc0_p (PATTERN (this_insn)))
- {
- out = 0;
- rld[i].out = 0;
- rld[i].inc = find_inc_amount (PATTERN (this_insn), in);
- /* If we did not find a nonzero amount-to-increment-by,
- that contradicts the belief that IN is being incremented
- in an address in this insn. */
- gcc_assert (rld[i].inc != 0);
- }
-#endif
-
/* If we will replace IN and OUT with the reload-reg,
record where they are located so that substitution need
not do a tree walk. */
@@ -2177,21 +2156,21 @@ hard_reg_set_here_p (unsigned int beg_regno, unsigned int end_regno, rtx x)
return 0;
}
-/* Return 1 if ADDR is a valid memory address for mode MODE
+/* Return true if ADDR is a valid memory address for mode MODE
in address space AS, and check that each pseudo reg has the
proper kind of hard reg. */
-int
+bool
strict_memory_address_addr_space_p (machine_mode mode ATTRIBUTE_UNUSED,
rtx addr, addr_space_t as)
{
#ifdef GO_IF_LEGITIMATE_ADDRESS
gcc_assert (ADDR_SPACE_GENERIC_P (as));
GO_IF_LEGITIMATE_ADDRESS (mode, addr, win);
- return 0;
+ return false;
win:
- return 1;
+ return true;
#else
return targetm.addr_space.legitimate_address_p (mode, addr, 1, as);
#endif
@@ -2310,6 +2289,11 @@ operands_match_p (rtx x, rtx y)
CASE_CONST_UNIQUE:
return 0;
+ case CONST_VECTOR:
+ if (!same_vector_encodings_p (x, y))
+ return false;
+ break;
+
case LABEL_REF:
return label_ref_label (x) == label_ref_label (y);
case SYMBOL_REF:
@@ -2691,17 +2675,10 @@ find_reloads (rtx_insn *insn, int replace, int ind_levels, int live_known,
}
}
- /* JUMP_INSNs and CALL_INSNs are not allowed to have any output reloads;
- neither are insns that SET cc0. Insns that use CC0 are not allowed
- to have any input reloads. */
+ /* JUMP_INSNs and CALL_INSNs are not allowed to have any output reloads. */
if (JUMP_P (insn) || CALL_P (insn))
no_output_reloads = 1;
- if (HAVE_cc0 && reg_referenced_p (cc0_rtx, PATTERN (insn)))
- no_input_reloads = 1;
- if (HAVE_cc0 && reg_set_p (cc0_rtx, PATTERN (insn)))
- no_output_reloads = 1;
-
/* The eliminated forms of any secondary memory locations are per-insn, so
clear them out here. */
@@ -3471,6 +3448,7 @@ find_reloads (rtx_insn *insn, int replace, int ind_levels, int live_known,
break;
case CT_MEMORY:
+ case CT_RELAXED_MEMORY:
if (force_reload)
break;
if (constraint_satisfied_p (operand, cn))
@@ -4579,15 +4557,6 @@ find_reloads (rtx_insn *insn, int replace, int ind_levels, int live_known,
rld[j].in = 0;
}
- /* If we made any reloads for addresses, see if they violate a
- "no input reloads" requirement for this insn. But loads that we
- do after the insn (such as for output addresses) are fine. */
- if (HAVE_cc0 && no_input_reloads)
- for (i = 0; i < n_reloads; i++)
- gcc_assert (rld[i].in == 0
- || rld[i].when_needed == RELOAD_FOR_OUTADDR_ADDRESS
- || rld[i].when_needed == RELOAD_FOR_OUTPUT_ADDRESS);
-
/* Compute reload_mode and reload_nregs. */
for (i = 0; i < n_reloads; i++)
{
@@ -4860,11 +4829,11 @@ make_memloc (rtx ad, int regno)
to mode MODE in address space AS by reloading the part pointed to
by PART into a register. */
-static int
+static bool
maybe_memory_address_addr_space_p (machine_mode mode, rtx ad,
addr_space_t as, rtx *part)
{
- int retv;
+ bool retv;
rtx tem = *part;
rtx reg = gen_rtx_REG (GET_MODE (tem), max_reg_num ());
@@ -5317,7 +5286,6 @@ subst_reg_equivs (rtx ad, rtx_insn *insn)
case SYMBOL_REF:
case LABEL_REF:
case PC:
- case CC0:
return ad;
case REG:
@@ -5856,7 +5824,7 @@ find_reloads_address_1 (machine_mode mode, addr_space_t as,
/* If we can output the register afterwards, do so, this
saves the extra update.
We can do so if we have an INSN - i.e. no JUMP_INSN nor
- CALL_INSN - and it does not set CC0.
+ CALL_INSN.
But don't do this if we cannot directly address the
memory location, since this will make it harder to
reuse address reloads, and increases register pressure.
@@ -5866,9 +5834,6 @@ find_reloads_address_1 (machine_mode mode, addr_space_t as,
: reg_equiv_mem (regno));
enum insn_code icode = optab_handler (add_optab, GET_MODE (x));
if (insn && NONJUMP_INSN_P (insn)
-#if HAVE_cc0
- && ! sets_cc0_p (PATTERN (insn))
-#endif
&& (regno < FIRST_PSEUDO_REGISTER
|| (equiv
&& memory_operand (equiv, GET_MODE (equiv))
@@ -6615,8 +6580,7 @@ reg_overlap_mentioned_for_reload_p (rtx x, rtx in)
}
else if (MEM_P (x))
return refers_to_mem_for_reload_p (in);
- else if (GET_CODE (x) == SCRATCH || GET_CODE (x) == PC
- || GET_CODE (x) == CC0)
+ else if (GET_CODE (x) == SCRATCH || GET_CODE (x) == PC)
return reg_mentioned_p (x, in);
else
{