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. */
if (TYPE_ALIAS_SET_KNOWN_P (t))
return TYPE_ALIAS_SET (t);
+ /* We don't want to set TYPE_ALIAS_SET for incomplete types. */
+ if (!COMPLETE_TYPE_P (t))
+ {
+ /* For arrays with unknown size the conservative answer is the
+ alias set of the element type. */
+ if (TREE_CODE (t) == ARRAY_TYPE)
+ return get_alias_set (TREE_TYPE (t));
+
+ /* But return zero as a conservative answer for incomplete types. */
+ return 0;
+ }
+
/* See if the language has special handling for this type. */
set = lang_hooks.get_alias_set (t);
if (set != -1)
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;
}