[Bug middle-end/94539] [10 Regression] gcc.dg/alias-14.c fails on gcc 10, succeeds on gcc 9, when turned into an execution test
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Apr 14 11:15:42 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94539
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Like
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index df9ba0de0d6..2850141303e 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -831,6 +831,15 @@ same_type_for_tbaa (tree type1, tree type2)
&& TREE_CODE (type2) == ARRAY_TYPE)
return -1;
+ /* void * is compatible with all other pointers. */
+ if (POINTER_TYPE_P (type1)
+ && POINTER_TYPE_P (type2)
+ && (TREE_CODE (TREE_TYPE (type1)) == VOID_TYPE
+ || TYPE_STRUCTURAL_EQUALITY_P (TREE_TYPE (type1))
+ || TREE_CODE (TREE_TYPE (type2)) == VOID_TYPE
+ || TYPE_STRUCTURAL_EQUALITY_P (TREE_TYPE (type2))))
+ return -1;
+
/* ??? In Ada, an lvalue of an unconstrained type can be used to access an
object of one of its constrained subtypes, e.g. when a function with an
unconstrained parameter passed by reference is called on an object and
More information about the Gcc-bugs
mailing list