diff options
author | Richard Biener <rguenther@suse.de> | 2014-05-20 08:16:13 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-05-20 08:16:13 +0000 |
commit | d1c0308e9b0f99d008b1aad2f955d1a423715a81 (patch) | |
tree | 64cca862e3e1fdc3c2795649bc8b94442a0f1313 /gcc/tree-ssa-sccvn.c | |
parent | 54da09ee2062f41141dbfd116975ee20509a96e3 (diff) | |
download | gcc-d1c0308e9b0f99d008b1aad2f955d1a423715a81.zip gcc-d1c0308e9b0f99d008b1aad2f955d1a423715a81.tar.gz gcc-d1c0308e9b0f99d008b1aad2f955d1a423715a81.tar.bz2 |
re PR tree-optimization/61221 (ICE on valid code at -O1 and above on x86_64-linux-gnu)
2014-05-20 Richard Biener <rguenther@suse.de>
PR tree-optimization/61221
* tree-ssa-pre.c (el_to_update): Remove.
(eliminate_dom_walker::before_dom_children): Handle released
VDEFs by value-numbering them to the associated VUSE. Update
stmt immediately for substituted call address.
(eliminate): Remove delayed stmt updating code.
* tree-ssa-sccvn.c (vuse_ssa_val): New function valueizing
possibly late re-numbered vuses.
(vn_reference_lookup_2): Adjust.
(vn_reference_lookup_pieces): Likewise.
(vn_reference_lookup): Likewise.
From-SVN: r210633
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index fc00682..73362f8 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -318,6 +318,25 @@ static int *rpo_numbers; #define SSA_VAL(x) (VN_INFO ((x))->valnum) +/* Return the SSA value of the VUSE x, supporting released VDEFs + during elimination which will value-number the VDEF to the + associated VUSE (but not substitute in the whole lattice). */ + +static inline tree +vuse_ssa_val (tree x) +{ + if (!x) + return NULL_TREE; + + do + { + x = SSA_VAL (x); + } + while (SSA_NAME_IN_FREE_LIST (x)); + + return x; +} + /* This represents the top of the VN lattice, which is the universal value. */ @@ -1495,7 +1514,7 @@ vn_reference_lookup_2 (ao_ref *op ATTRIBUTE_UNUSED, tree vuse, /* Fixup vuse and hash. */ if (vr->vuse) vr->hashcode = vr->hashcode - SSA_NAME_VERSION (vr->vuse); - vr->vuse = SSA_VAL (vuse); + vr->vuse = vuse_ssa_val (vuse); if (vr->vuse) vr->hashcode = vr->hashcode + SSA_NAME_VERSION (vr->vuse); @@ -2035,7 +2054,7 @@ vn_reference_lookup_pieces (tree vuse, alias_set_type set, tree type, vnresult = &tmp; *vnresult = NULL; - vr1.vuse = vuse ? SSA_VAL (vuse) : NULL_TREE; + vr1.vuse = vuse_ssa_val (vuse); shared_lookup_references.truncate (0); shared_lookup_references.safe_grow (operands.length ()); memcpy (shared_lookup_references.address (), @@ -2090,7 +2109,7 @@ vn_reference_lookup (tree op, tree vuse, vn_lookup_kind kind, if (vnresult) *vnresult = NULL; - vr1.vuse = vuse ? SSA_VAL (vuse) : NULL_TREE; + vr1.vuse = vuse_ssa_val (vuse); vr1.operands = operands = valueize_shared_reference_ops_from_ref (op, &valuezied_anything); vr1.type = TREE_TYPE (op); |