Commit 33e8e0ee by Martin Liska Committed by Martin Liska

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
parent 97bf048c
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
......
......@@ -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. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment