/* If the innermost reference is a MEM_REF that has a
conversion embedded treat it like a VIEW_CONVERT_EXPR above,
using the memory access type for determining the alias-set. */
- if (TREE_CODE (inner) == MEM_REF
- && (TYPE_MAIN_VARIANT (TREE_TYPE (inner))
- != TYPE_MAIN_VARIANT
- (TREE_TYPE (TREE_TYPE (TREE_OPERAND (inner, 1))))))
+ if (view_converted_memref_p (inner))
{
tree alias_ptrtype = TREE_TYPE (TREE_OPERAND (inner, 1));
/* Unless we have the (aggregate) effective type of the access
int compare_base_decls (tree, tree);
bool refs_same_for_tbaa_p (tree, tree);
bool mems_same_for_tbaa_p (rtx, rtx);
+bool view_converted_memref_p (tree);
/* This alias set can be used to force a memory to conflict with all
other memories, creating a barrier across which no memory reference
which is done by ao_ref_base and thus one extra walk
of handled components is needed. */
-static bool
+bool
view_converted_memref_p (tree base)
{
if (TREE_CODE (base) != MEM_REF && TREE_CODE (base) != TARGET_MEM_REF)
else if ((end_struct_ref1 != NULL) != (end_struct_ref2 != NULL))
return flags | ACCESS_PATH;
if (end_struct_ref1
- && TYPE_MAIN_VARIANT (TREE_TYPE (end_struct_ref1))
- != TYPE_MAIN_VARIANT (TREE_TYPE (end_struct_ref2)))
+ && same_type_for_tbaa (TREE_TYPE (end_struct_ref1),
+ TREE_TYPE (end_struct_ref2)) != 1)
return flags | ACCESS_PATH;
/* Now compare all handled components of the access path.