From: hubicka Date: Fri, 23 Oct 2015 18:05:55 +0000 (+0000) Subject: * fold-const.c (operand_equal_p): Do not compare TYPE_MODE when X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2425f3b6ce0532030e1e4274d0fc82a5d7e16c79;p=thirdparty%2Fgcc.git * fold-const.c (operand_equal_p): Do not compare TYPE_MODE when comparing addresses. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229265 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index df246e672ed9..716b6320e42d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-10-23 Jan Hubicka + + * fold-const.c (operand_equal_p): Do not compare TYPE_MODE when + comparing addresses. + 2015-10-23 Jan Hubicka * fold-const.c (operand_equal_p): Handle matching of vector diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 018cb03f8995..df49f87f716a 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -2809,11 +2809,12 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags) 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.