aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.c
diff options
context:
space:
mode:
authorRichard Biener <rguenth@gcc.gnu.org>2010-06-26 13:24:57 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-06-26 13:24:57 +0000
commit6bfd4302547d10962648eb1dddd4020cf8017ada (patch)
tree104b2d207cbd261c891afcb11e15abb3824be693 /gcc/tree-ssa-alias.c
parent922e18828a123733841dd652f8a78bfd13ac9856 (diff)
downloadgcc-6bfd4302547d10962648eb1dddd4020cf8017ada.zip
gcc-6bfd4302547d10962648eb1dddd4020cf8017ada.tar.gz
gcc-6bfd4302547d10962648eb1dddd4020cf8017ada.tar.bz2
re PR tree-optimization/44674 (ICE: in refs_may_alias_p_1, at tree-ssa-alias.c:953 with -fprofile-generate)
2010-06-26 Richard Guenther <rguenther@suse.de> PR middle-end/44674 * tree-ssa-alias.c (refs_may_alias_p_1): Allow all kind of decls. Handle LABEL_DECLs like FUNCTION_DECLs. * gcc.dg/pr44674.c: New testcase. From-SVN: r161431
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r--gcc/tree-ssa-alias.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index e6836d77..95f26f1 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -800,18 +800,16 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
bool var1_p, var2_p, ind1_p, ind2_p;
alias_set_type set;
- gcc_assert ((!ref1->ref
- || SSA_VAR_P (ref1->ref)
- || handled_component_p (ref1->ref)
- || INDIRECT_REF_P (ref1->ref)
- || TREE_CODE (ref1->ref) == TARGET_MEM_REF
- || TREE_CODE (ref1->ref) == CONST_DECL)
- && (!ref2->ref
- || SSA_VAR_P (ref2->ref)
- || handled_component_p (ref2->ref)
- || INDIRECT_REF_P (ref2->ref)
- || TREE_CODE (ref2->ref) == TARGET_MEM_REF
- || TREE_CODE (ref2->ref) == CONST_DECL));
+ gcc_checking_assert ((!ref1->ref
+ || DECL_P (ref1->ref)
+ || handled_component_p (ref1->ref)
+ || INDIRECT_REF_P (ref1->ref)
+ || TREE_CODE (ref1->ref) == TARGET_MEM_REF)
+ && (!ref2->ref
+ || DECL_P (ref2->ref)
+ || handled_component_p (ref2->ref)
+ || INDIRECT_REF_P (ref2->ref)
+ || TREE_CODE (ref2->ref) == TARGET_MEM_REF));
/* Decompose the references into their base objects and the access. */
base1 = ao_ref_base (ref1);
@@ -832,10 +830,13 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
|| is_gimple_min_invariant (base2))
return false;
- /* We can end up refering to code via function decls. As we likely
- do not properly track code aliases conservatively bail out. */
+ /* We can end up refering to code via function and label decls.
+ As we likely do not properly track code aliases conservatively
+ bail out. */
if (TREE_CODE (base1) == FUNCTION_DECL
- || TREE_CODE (base2) == FUNCTION_DECL)
+ || TREE_CODE (base2) == FUNCTION_DECL
+ || TREE_CODE (base1) == LABEL_DECL
+ || TREE_CODE (base2) == LABEL_DECL)
return true;
/* Defer to simple offset based disambiguation if we have