aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2010-09-08 21:53:48 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2010-09-08 21:53:48 +0000
commit359bea1da45819206bf0a9132362ee6e0f181282 (patch)
tree51a704702b2ef87537d068e5ea5a55d72cb03512 /gcc/fold-const.c
parent0a7822a32b830084f37e78545047ce0d4e5cd486 (diff)
downloadgcc-359bea1da45819206bf0a9132362ee6e0f181282.zip
gcc-359bea1da45819206bf0a9132362ee6e0f181282.tar.gz
gcc-359bea1da45819206bf0a9132362ee6e0f181282.tar.bz2
re PR debug/45419 (-fcompare-debug failure at -O3)
PR debug/45419 PR debug/45408 * tree-pretty-print.c (dump_generic_node): Disregard top-level qualifiers in otherwise equal MEM_REF pointer types. * fold-const.c (operand_equal_p): Compare pointer type of MEM_REFs. * tree.c (iterative_hash_expr): Hash the pointer type of MEM_REFs. From-SVN: r164031
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index baac13f..c941703 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2591,14 +2591,17 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
return OP_SAME (0);
case MEM_REF:
- /* Require equal access sizes. We can have incomplete types
- for array references of variable-sized arrays from the
- Fortran frontent though. */
+ /* Require equal access sizes, and similar pointer types.
+ We can have incomplete types for array references of
+ variable-sized arrays from the Fortran frontent
+ though. */
return ((TYPE_SIZE (TREE_TYPE (arg0)) == TYPE_SIZE (TREE_TYPE (arg1))
|| (TYPE_SIZE (TREE_TYPE (arg0))
&& TYPE_SIZE (TREE_TYPE (arg1))
&& operand_equal_p (TYPE_SIZE (TREE_TYPE (arg0)),
TYPE_SIZE (TREE_TYPE (arg1)), flags)))
+ && (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (arg0, 1)))
+ == TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (arg1, 1))))
&& OP_SAME (0) && OP_SAME (1));
case ARRAY_REF: