From: Jan Hubicka Date: Fri, 23 Oct 2015 18:05:55 +0000 (+0200) Subject: fold-const.c (operand_equal_p): Do not compare TYPE_MODE when comparing addresses. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=addf86347db70c659be57197ac92d9abe0549bd8;p=gcc.git fold-const.c (operand_equal_p): Do not compare TYPE_MODE when comparing addresses. * fold-const.c (operand_equal_p): Do not compare TYPE_MODE when comparing addresses. From-SVN: r229265 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index df246e672ed..716b6320e42 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 018cb03f899..df49f87f716 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.