diff options
author | Martin Liska <mliska@suse.cz> | 2019-08-09 14:06:30 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2019-08-09 12:06:30 +0000 |
commit | 33e8e0ee4cd185f5073546fed2199c6ec76933ca (patch) | |
tree | 287e6e2239474fa8a4b2fc2ff69e4bb973982fee | |
parent | 97bf048c04d93ba1e0265893fdb06f8991c149f7 (diff) | |
download | gcc-33e8e0ee4cd185f5073546fed2199c6ec76933ca.zip gcc-33e8e0ee4cd185f5073546fed2199c6ec76933ca.tar.gz gcc-33e8e0ee4cd185f5073546fed2199c6ec76933ca.tar.bz2 |
Strengthen alias_ptr_types_compatible_p in LTO mode.
2019-08-09 Martin Liska <mliska@suse.cz>
* alias.c (alias_ptr_types_compatible_p): Strengten
type comparison in LTO mode.
From-SVN: r274235
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/alias.c | 12 |
2 files changed, 15 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index beffd1b..e9fd078 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-08-09 Martin Liska <mliska@suse.cz> + + * alias.c (alias_ptr_types_compatible_p): Strengten + type comparison in LTO mode. + 2019-08-09 Richard Sandiford <richard.sandiford@arm.com> PR middle-end/90313 diff --git a/gcc/alias.c b/gcc/alias.c index 2755df7..1579dfa 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -793,8 +793,16 @@ alias_ptr_types_compatible_p (tree t1, tree t2) || ref_all_alias_ptr_type_p (t2)) return false; - return (TYPE_MAIN_VARIANT (TREE_TYPE (t1)) - == TYPE_MAIN_VARIANT (TREE_TYPE (t2))); + /* This function originally abstracts from simply comparing + get_deref_alias_set so that we are sure this still computes + the same result after LTO type merging is applied. + When in LTO type merging is done we can actually do this compare. + */ + if (in_lto_p) + return get_deref_alias_set (t1) == get_deref_alias_set (t2); + else + return (TYPE_MAIN_VARIANT (TREE_TYPE (t1)) + == TYPE_MAIN_VARIANT (TREE_TYPE (t2))); } /* Create emptry alias set entry. */ |