Hi, this patch disables TYPE_MODE comparing when we care about address only. I already disabled other matching of types, but missed this one as it is placed later in the function body.
Bootstrapped/regtested x86_64-linux, OK? Honza * fold-const.c (operand_equal_p): Do not compare TYPE_MODE when only address matters. Index: fold-const.c =================================================================== --- fold-const.c (revision 229153) +++ fold-const.c (working copy) @@ -2809,11 +2809,12 @@ operand_equal_p (const_tree arg0, const_ return 0; } - /* This is needed for conversions and for COMPONENT_REF. - Might as well play it safe and always test this. */ + /* When not checking adddresses, this is needed for conversions and for + COMPONENT_REF. Might as well play it safe and always test this. */ if (TREE_CODE (TREE_TYPE (arg0)) == ERROR_MARK || TREE_CODE (TREE_TYPE (arg1)) == ERROR_MARK - || TYPE_MODE (TREE_TYPE (arg0)) != TYPE_MODE (TREE_TYPE (arg1))) + || (TYPE_MODE (TREE_TYPE (arg0)) != TYPE_MODE (TREE_TYPE (arg1)) + && !(flags & OEP_ADDRESS_OF))) return 0; /* If ARG0 and ARG1 are the same SAVE_EXPR, they are necessarily equal.