aboutsummaryrefslogtreecommitdiff
path: root/gcc/symtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/symtab.c')
-rw-r--r--gcc/symtab.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/symtab.c b/gcc/symtab.c
index d037fe6..f9e4571 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -2276,6 +2276,14 @@ symtab_node::equal_address_to (symtab_node *s2, bool memory_accessed)
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.