static tree handle_simd_attribute (tree *, tree, tree, int, bool *);
static tree handle_omp_declare_target_attribute (tree *, tree, tree, int,
bool *);
+static tree handle_non_overlapping_attribute (tree *, tree, tree, int, bool *);
static tree handle_designated_init_attribute (tree *, tree, tree, int, bool *);
static tree handle_patchable_function_entry_attribute (tree *, tree, tree,
int, bool *);
handle_omp_declare_target_attribute, NULL },
{ "omp declare target block", 0, 0, true, false, false, false,
handle_omp_declare_target_attribute, NULL },
+ { "non overlapping", 0, 0, true, false, false, false,
+ handle_non_overlapping_attribute, NULL },
{ "alloc_align", 1, 1, false, true, true, false,
handle_alloc_align_attribute,
attr_alloc_exclusions },
return NULL_TREE;
}
+/* Handle an "non overlapping" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_non_overlapping_attribute (tree *, tree, tree, int, bool *)
+{
+ return NULL_TREE;
+}
+
/* Handle a "returns_twice" attribute; arguments as in
struct attribute_spec.handler. */
DECL_IGNORED_P (d) = 1;
TREE_READONLY (d) = 1;
TREE_STATIC (d) = 1;
+ /* Tell equal_address_to that different tinfo decls never
+ overlap. */
+ if (vec_safe_is_empty (unemitted_tinfo_decls))
+ DECL_ATTRIBUTES (d)
+ = build_tree_list (get_identifier ("non overlapping"),
+ NULL_TREE);
+ else
+ DECL_ATTRIBUTES (d)
+ = DECL_ATTRIBUTES ((*unemitted_tinfo_decls)[0]);
/* Mark the variable as undefined -- but remember that we can
define it later if we need to do so. */
return 0;
}
+ /* If the FE tells us at least one of the decls will never be aliased nor
+ overlapping with other vars in some other way, return 0. */
+ if (VAR_P (decl)
+ && rs1 != rs2
+ && (lookup_attribute ("non overlapping", DECL_ATTRIBUTES (decl))
+ || lookup_attribute ("non overlapping", DECL_ATTRIBUTES (s2->decl))))
+ return 0;
+
/* TODO: Alias oracle basically assume that addresses of global variables
are different unless they are declared as alias of one to another while
the code folding comparisons doesn't.