aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-10-23 20:05:55 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2015-10-23 18:05:55 +0000
commitaddf86347db70c659be57197ac92d9abe0549bd8 (patch)
tree61570527ba527a6ae52140531222e0f54fb3980f /gcc/fold-const.c
parent980002c6e997b5bce8a2be92ef4cd1f893fc82b5 (diff)
downloadgcc-addf86347db70c659be57197ac92d9abe0549bd8.zip
gcc-addf86347db70c659be57197ac92d9abe0549bd8.tar.gz
gcc-addf86347db70c659be57197ac92d9abe0549bd8.tar.bz2
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
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 018cb03..df49f87 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.