This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][mem-ref2] Fix operand_equal_p of MEM_REF
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 11 Jun 2010 17:49:59 +0200 (CEST)
- Subject: [PATCH][mem-ref2] Fix operand_equal_p of MEM_REF
Bootstrapped on x86_64-unknown-linux-gnu, committed to the branch.
Richard.
2010-06-11 Richard Guenther <rguenther@suse.de>
* fold-const.c (operand_equal_p): When comparing two MEM_REFs
require the same access size.
Index: gcc/fold-const.c
===================================================================
*** gcc/fold-const.c (revision 160604)
--- gcc/fold-const.c (working copy)
*************** operand_equal_p (const_tree arg0, const_
*** 2615,2621 ****
return OP_SAME (0);
case MEM_REF:
! return OP_SAME (0) && OP_SAME (1);
case ARRAY_REF:
case ARRAY_RANGE_REF:
--- 2615,2629 ----
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. */
! 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)))
! && OP_SAME (0) && OP_SAME (1));
case ARRAY_REF:
case ARRAY_RANGE_REF: