From: Richard Guenther Date: Thu, 15 May 2008 10:36:18 +0000 (+0000) Subject: tree-dfa.c (refs_may_alias_p): Allow all kinds of INDIRECT_REF and TARGET_MEM_REF. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9f59420d5c2a4c94a1d3c7c82988ffcd672cae9c;p=gcc.git tree-dfa.c (refs_may_alias_p): Allow all kinds of INDIRECT_REF and TARGET_MEM_REF. 2008-05-15 Richard Guenther * tree-dfa.c (refs_may_alias_p): Allow all kinds of INDIRECT_REF and TARGET_MEM_REF. * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle TARGET_MEM_REF. From-SVN: r135332 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a76ec9d81ef..9a91ab4ea90 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2008-05-15 Richard Guenther + + * tree-dfa.c (refs_may_alias_p): Allow all kinds of + INDIRECT_REF and TARGET_MEM_REF. + * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle + TARGET_MEM_REF. + 2008-05-15 Uros Bizjak H.J. Lu diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 622930ff5d3..f9784411e41 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -996,10 +996,12 @@ refs_may_alias_p (tree ref1, tree ref2) gcc_assert ((SSA_VAR_P (ref1) || handled_component_p (ref1) - || TREE_CODE (ref1) == INDIRECT_REF) + || INDIRECT_REF_P (ref1) + || TREE_CODE (ref1) == TARGET_MEM_REF) && (SSA_VAR_P (ref2) || handled_component_p (ref2) - || TREE_CODE (ref2) == INDIRECT_REF)); + || INDIRECT_REF_P (ref2) + || TREE_CODE (ref2) == TARGET_MEM_REF)); /* Defer to TBAA if possible. */ if (flag_strict_aliasing diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index f5ec0a737b4..e8eb437d3e6 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -504,6 +504,27 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result) return; } + if (TREE_CODE (ref) == TARGET_MEM_REF) + { + vn_reference_op_s temp; + + memset (&temp, 0, sizeof (temp)); + /* We do not care for spurious type qualifications. */ + temp.type = TYPE_MAIN_VARIANT (TREE_TYPE (ref)); + temp.opcode = TREE_CODE (ref); + temp.op0 = TMR_SYMBOL (ref) ? TMR_SYMBOL (ref) : TMR_BASE (ref); + temp.op1 = TMR_INDEX (ref); + VEC_safe_push (vn_reference_op_s, heap, *result, &temp); + + memset (&temp, 0, sizeof (temp)); + temp.type = NULL_TREE; + temp.opcode = TREE_CODE (ref); + temp.op0 = TMR_STEP (ref); + temp.op1 = TMR_OFFSET (ref); + VEC_safe_push (vn_reference_op_s, heap, *result, &temp); + return; + } + /* For non-calls, store the information that makes up the address. */ while (ref)