static int nonoverlapping_memrefs_p (const_rtx, const_rtx);
static int write_dependence_p (const_rtx, const_rtx, int);
-static void memory_modified_1 (const_rtx, const_rtx, const void *);
+static void memory_modified_1 (rtx, const_rtx, void *);
static void record_alias_subset (alias_set_type, alias_set_type);
/* Set up all info needed to perform alias analysis on memory references. */
to be memory reference. */
static bool memory_modified;
static void
-memory_modified_1 (const_rtx x, const_rtx pat ATTRIBUTE_UNUSED, const void *data)
+memory_modified_1 (rtx x, const_rtx pat ATTRIBUTE_UNUSED, void *data)
{
if (MEM_P (x))
{
if (!INSN_P (insn))
return false;
memory_modified = false;
- const_note_stores (PATTERN (insn), memory_modified_1, mem);
+ note_stores (PATTERN (insn), memory_modified_1, CONST_CAST_RTX(mem));
return memory_modified;
}
extern int reg_overlap_mentioned_p (const_rtx, const_rtx);
extern const_rtx set_of (const_rtx, const_rtx);
extern void note_stores (const_rtx, void (*) (rtx, const_rtx, void *), void *);
-extern void const_note_stores (const_rtx, void (*) (const_rtx, const_rtx, const void *), const void *);
extern void note_uses (rtx *, void (*) (rtx *, void *), void *);
extern int dead_or_set_p (const_rtx, const_rtx);
extern int dead_or_set_regno_p (const_rtx, unsigned int);
If the item being stored in or clobbered is a SUBREG of a hard register,
the SUBREG will be passed. */
-#define NOTE_STORES_BODY(NOTE_STORES_FN) do { \
- int i; \
- if (GET_CODE (x) == COND_EXEC) \
- x = COND_EXEC_CODE (x); \
- if (GET_CODE (x) == SET || GET_CODE (x) == CLOBBER) \
- { \
- rtx dest = SET_DEST (x); \
- while ((GET_CODE (dest) == SUBREG \
- && (!REG_P (SUBREG_REG (dest)) \
- || REGNO (SUBREG_REG (dest)) >= FIRST_PSEUDO_REGISTER)) \
- || GET_CODE (dest) == ZERO_EXTRACT \
- || GET_CODE (dest) == STRICT_LOW_PART) \
- dest = XEXP (dest, 0); \
- /* If we have a PARALLEL, SET_DEST is a list of EXPR_LIST expressions, \
- each of whose first operand is a register. */ \
- if (GET_CODE (dest) == PARALLEL) \
- { \
- for (i = XVECLEN (dest, 0) - 1; i >= 0; i--) \
- if (XEXP (XVECEXP (dest, 0, i), 0) != 0) \
- (*fun) (XEXP (XVECEXP (dest, 0, i), 0), x, data); \
- } \
- else \
- (*fun) (dest, x, data); \
- } \
- else if (GET_CODE (x) == PARALLEL) \
- for (i = XVECLEN (x, 0) - 1; i >= 0; i--) \
- NOTE_STORES_FN (XVECEXP (x, 0, i), fun, data); \
-} while (0)
-
void
note_stores (const_rtx x, void (*fun) (rtx, const_rtx, void *), void *data)
{
- NOTE_STORES_BODY(note_stores);
-}
+ int i;
-void
-const_note_stores (const_rtx x, void (*fun) (const_rtx, const_rtx, const void *), const void *data)
-{
- NOTE_STORES_BODY(const_note_stores);
-}
+ if (GET_CODE (x) == COND_EXEC)
+ x = COND_EXEC_CODE (x);
-#undef NOTE_STORES_BODY
+ if (GET_CODE (x) == SET || GET_CODE (x) == CLOBBER)
+ {
+ rtx dest = SET_DEST (x);
+
+ while ((GET_CODE (dest) == SUBREG
+ && (!REG_P (SUBREG_REG (dest))
+ || REGNO (SUBREG_REG (dest)) >= FIRST_PSEUDO_REGISTER))
+ || GET_CODE (dest) == ZERO_EXTRACT
+ || GET_CODE (dest) == STRICT_LOW_PART)
+ dest = XEXP (dest, 0);
+
+ /* If we have a PARALLEL, SET_DEST is a list of EXPR_LIST expressions,
+ each of whose first operand is a register. */
+ if (GET_CODE (dest) == PARALLEL)
+ {
+ for (i = XVECLEN (dest, 0) - 1; i >= 0; i--)
+ if (XEXP (XVECEXP (dest, 0, i), 0) != 0)
+ (*fun) (XEXP (XVECEXP (dest, 0, i), 0), x, data);
+ }
+ else
+ (*fun) (dest, x, data);
+ }
+ else if (GET_CODE (x) == PARALLEL)
+ for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
+ note_stores (XVECEXP (x, 0, i), fun, data);
+}
\f
/* Like notes_stores, but call FUN for each expression that is being
referenced in PBODY, a pointer to the PATTERN of an insn. We only call