This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][mem-ref2] Fixup missing TBAA
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 15 Jun 2010 14:36:30 +0200 (CEST)
- Subject: [PATCH][mem-ref2] Fixup missing TBAA
This restores some TBAA that I disabled by being too conservative.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to the
branch.
Richard.
2010-06-15 Richard Guenther <rguenther@suse.de>
* alias.c (get_alias_set): Handle non-converting MEM_REFs
like regular references.
Index: gcc/alias.c
===================================================================
*** gcc/alias.c (revision 160753)
--- gcc/alias.c (working copy)
*************** get_alias_set (tree t)
*** 676,682 ****
return set;
}
else if (TREE_CODE (inner) == MEM_REF)
! return get_deref_alias_set (TREE_OPERAND (inner, 1));
/* Otherwise, pick up the outermost object that we could have a pointer
to, processing conversions as above. */
--- 676,690 ----
return set;
}
else if (TREE_CODE (inner) == MEM_REF)
! {
! /* If this is a converting MEM_REF then the type of the reference
! chain is not valid for alias-set queries. */
! tree ptrtype = TREE_TYPE (TREE_OPERAND (inner, 1));
! if (TYPE_REF_CAN_ALIAS_ALL (ptrtype)
! || (TYPE_MAIN_VARIANT (TREE_TYPE (inner))
! != TYPE_MAIN_VARIANT (TREE_TYPE (ptrtype))))
! return get_deref_alias_set (ptrtype);
! }
/* Otherwise, pick up the outermost object that we could have a pointer
to, processing conversions as above. */