case ADDR_EXPR:
return operand_equal_p (TREE_OPERAND (arg0, 0), TREE_OPERAND (arg1, 0),
TREE_CONSTANT (arg0) && TREE_CONSTANT (arg1)
- ? OEP_CONSTANT_ADDRESS_OF : 0);
+ ? OEP_CONSTANT_ADDRESS_OF | OEP_ADDRESS_OF : 0);
default:
break;
}
switch (TREE_CODE (arg0))
{
case INDIRECT_REF:
- flags &= ~OEP_CONSTANT_ADDRESS_OF;
+ if (!(flags & OEP_ADDRESS_OF)
+ && (TYPE_ALIGN (TREE_TYPE (arg0))
+ != TYPE_ALIGN (TREE_TYPE (arg1))))
+ return 0;
+ flags &= ~(OEP_CONSTANT_ADDRESS_OF|OEP_ADDRESS_OF);
return OP_SAME (0);
case REALPART_EXPR:
return OP_SAME (0);
case TARGET_MEM_REF:
- flags &= ~OEP_CONSTANT_ADDRESS_OF;
+ flags &= ~(OEP_CONSTANT_ADDRESS_OF|OEP_ADDRESS_OF);
/* Require equal extra operands and then fall through to MEM_REF
handling of the two common operands. */
if (!OP_SAME_WITH_NULL (2)
return 0;
/* Fallthru. */
case MEM_REF:
- flags &= ~OEP_CONSTANT_ADDRESS_OF;
+ flags &= ~(OEP_CONSTANT_ADDRESS_OF|OEP_ADDRESS_OF);
/* Require equal access sizes, and similar pointer types.
We can have incomplete types for array references of
variable-sized arrays from the Fortran frontend
&& operand_equal_p (TYPE_SIZE (TREE_TYPE (arg0)),
TYPE_SIZE (TREE_TYPE (arg1)), flags)))
&& types_compatible_p (TREE_TYPE (arg0), TREE_TYPE (arg1))
- && alias_ptr_types_compatible_p
- (TREE_TYPE (TREE_OPERAND (arg0, 1)),
- TREE_TYPE (TREE_OPERAND (arg1, 1)))
+ && ((flags & OEP_ADDRESS_OF)
+ || (alias_ptr_types_compatible_p
+ (TREE_TYPE (TREE_OPERAND (arg0, 1)),
+ TREE_TYPE (TREE_OPERAND (arg1, 1)))
+ && (MR_DEPENDENCE_CLIQUE (arg0)
+ == MR_DEPENDENCE_CLIQUE (arg1))
+ && (MR_DEPENDENCE_BASE (arg0)
+ == MR_DEPENDENCE_BASE (arg1))
+ && (TYPE_ALIGN (TREE_TYPE (arg0))
+ == TYPE_ALIGN (TREE_TYPE (arg1)))))
&& OP_SAME (0) && OP_SAME (1));
case ARRAY_REF:
may have different types but same value here. */
if (!OP_SAME (0))
return 0;
- flags &= ~OEP_CONSTANT_ADDRESS_OF;
+ flags &= ~(OEP_CONSTANT_ADDRESS_OF|OEP_ADDRESS_OF);
return ((tree_int_cst_equal (TREE_OPERAND (arg0, 1),
TREE_OPERAND (arg1, 1))
|| OP_SAME (1))
if (!OP_SAME_WITH_NULL (0)
|| !OP_SAME (1))
return 0;
- flags &= ~OEP_CONSTANT_ADDRESS_OF;
+ flags &= ~(OEP_CONSTANT_ADDRESS_OF|OEP_ADDRESS_OF);
return OP_SAME_WITH_NULL (2);
case BIT_FIELD_REF:
if (!OP_SAME (0))
return 0;
- flags &= ~OEP_CONSTANT_ADDRESS_OF;
+ flags &= ~(OEP_CONSTANT_ADDRESS_OF|OEP_ADDRESS_OF);
return OP_SAME (1) && OP_SAME (2);
default:
switch (TREE_CODE (arg0))
{
case ADDR_EXPR:
+ return operand_equal_p (TREE_OPERAND (arg0, 0),
+ TREE_OPERAND (arg1, 0),
+ flags | OEP_ADDRESS_OF);
+
case TRUTH_NOT_EXPR:
return OP_SAME (0);