This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 4/9] Strengthen alias_ptr_types_compatible_p in LTO mode.


gcc/ChangeLog:

2019-07-24  Martin Liska  <mliska@suse.cz>

	* alias.c (alias_ptr_types_compatible_p): Strengten
	type comparison in LTO mode.
---
 gcc/alias.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gcc/alias.c b/gcc/alias.c
index 2755df72907..bae4ddaebaf 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -793,8 +793,11 @@ 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)));
+  if (in_lto_p)
+    return get_alias_set (t1) == get_alias_set (t2);
+  else
+    return (TYPE_MAIN_VARIANT (TREE_TYPE (t1))
+	    == TYPE_MAIN_VARIANT (TREE_TYPE (t2)));
 }
 
 /* Create emptry alias set entry.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]