aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorSteven Bosscher <stevenb.gcc@gmail.com>2006-01-03 06:20:21 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2006-01-03 06:20:21 +0000
commit78b76d0884d435c6e05d023db71a8b00c0f044b2 (patch)
tree0f27e072946d5679715a3b35a103656388cb972e /gcc/fold-const.c
parent0884546e1b92fe109e30cca3295e6212e4b24567 (diff)
downloadgcc-78b76d0884d435c6e05d023db71a8b00c0f044b2.zip
gcc-78b76d0884d435c6e05d023db71a8b00c0f044b2.tar.gz
gcc-78b76d0884d435c6e05d023db71a8b00c0f044b2.tar.bz2
re PR rtl-optimization/25130 (miscompilation in GCSE)
* fold-const.c (operand_equal_p): Accept a NULL operand 0 for COMPONENT_REFs. * emit-rtl.c (mem_attrs_htab_eq): Use iterative_hash_expr for hashing trees instead of a pointer hash. (mem_attrs_htab_eq): Do a deep compare instead of a pointer compare for MEM_EXPR. PR rtl-optimization/25130 * cse.c (exp_equiv_p): Compare MEM_ATTRS instead of MEM_ALIAS_SET when comparing MEMs for GCSE From-SVN: r109264
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 2366c75..7cab3c4 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2635,8 +2635,11 @@ operand_equal_p (tree arg0, tree arg1, unsigned int flags)
&& OP_SAME_WITH_NULL (3));
case COMPONENT_REF:
- /* Handle operand 2 the same as for ARRAY_REF. */
- return OP_SAME (0) && OP_SAME (1) && OP_SAME_WITH_NULL (2);
+ /* Handle operand 2 the same as for ARRAY_REF. Operand 0
+ may be NULL when we're called to compare MEM_EXPRs. */
+ return OP_SAME_WITH_NULL (0)
+ && OP_SAME (1)
+ && OP_SAME_WITH_NULL (2);
case BIT_FIELD_REF:
return OP_SAME (0) && OP_SAME (1) && OP_SAME (2);