Commit e71b408a by Richard Biener

middle-end/94539 - void * aliases every other pointer

This makes same_type_for_tbaa_p conservative in the same way
get_alias_set is about void * which we allow to alias all other
pointers.

2020-04-15  Richard Biener  <rguenther@suse.de>

	PR middle-end/94539
	* tree-ssa-alias.c (same_type_for_tbaa): Defer to
	alias_sets_conflict_p for pointers.

	* gcc.dg/alias-14.c: Make dg-do run.
parent 5b6551bc
2020-04-15 Richard Biener <rguenther@suse.de>
PR middle-end/94539
* tree-ssa-alias.c (same_type_for_tbaa): Defer to
alias_sets_conflict_p for pointers.
2020-04-14 Max Filippov <jcmvbkbc@gmail.com>
PR target/94584
......
2020-04-15 Richard Biener <rguenther@suse.de>
PR middle-end/94539
* gcc.dg/alias-14.c: Make dg-do run.
2020-04-13 Max Filippov <jcmvbkbc@gmail.com>
PR target/94584
......
/* { dg-do compile } */
/* { dg-do run } */
/* { dg-options "-O2" } */
#include <stddef.h>
void *a;
......
......@@ -839,7 +839,16 @@ same_type_for_tbaa (tree type1, tree type2)
would mean that conversions between them are useless, whereas they are
not (e.g. type and subtypes can have different modes). So, in the end,
they are only guaranteed to have the same alias set. */
if (get_alias_set (type1) == get_alias_set (type2))
alias_set_type set1 = get_alias_set (type1);
alias_set_type set2 = get_alias_set (type2);
if (set1 == set2)
return -1;
/* Pointers to void are considered compatible with all other pointers,
so for two pointers see what the alias set resolution thinks. */
if (POINTER_TYPE_P (type1)
&& POINTER_TYPE_P (type2)
&& alias_sets_conflict_p (set1, set2))
return -1;
/* The types are known to be not equal. */
......
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