aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-10-14 12:58:18 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-10-14 12:58:18 +0000
commit6d59425df7e3d4e9b49c6521288a048bb35ec70c (patch)
tree7cdbd54e43186d9f5302e22e36538167ff60e172 /gcc/tree-vrp.c
parent43f66d6e1e49b600d5b1cef208995641232031d4 (diff)
downloadgcc-6d59425df7e3d4e9b49c6521288a048bb35ec70c.zip
gcc-6d59425df7e3d4e9b49c6521288a048bb35ec70c.tar.gz
gcc-6d59425df7e3d4e9b49c6521288a048bb35ec70c.tar.bz2
re PR tree-optimization/77979 (ICE on valid code at -Os and above on x86_64-linux-gnu: Segmentation fault)
2016-10-14 Richard Biener <rguenther@suse.de> PR tree-optimization/77979 * tree-vrp.c (compare_name_with_value): Handle released SSA names in the equivalency sets. (compare_names): Likewise. * gcc.dg/torture/pr77979.c: New testcase. From-SVN: r241162
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 941c0fd..00a08fd 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -7188,9 +7188,13 @@ compare_name_with_value (enum tree_code comp, tree var, tree val,
EXECUTE_IF_SET_IN_BITMAP (e, 0, i, bi)
{
+ tree name = ssa_name (i);
+ if (! name)
+ continue;
+
if (! use_equiv_p
- && ! SSA_NAME_IS_DEFAULT_DEF (ssa_name (i))
- && prop_simulate_again_p (SSA_NAME_DEF_STMT (ssa_name (i))))
+ && ! SSA_NAME_IS_DEFAULT_DEF (name)
+ && prop_simulate_again_p (SSA_NAME_DEF_STMT (name)))
continue;
equiv_vr = get_vr_for_comparison (i);
@@ -7289,11 +7293,17 @@ compare_names (enum tree_code comp, tree n1, tree n2,
of the loop just to check N1 and N2 ranges. */
EXECUTE_IF_SET_IN_BITMAP (e1, 0, i1, bi1)
{
+ if (! ssa_name (i1))
+ continue;
+
value_range vr1 = get_vr_for_comparison (i1);
t = retval = NULL_TREE;
EXECUTE_IF_SET_IN_BITMAP (e2, 0, i2, bi2)
{
+ if (! ssa_name (i2))
+ continue;
+
bool sop = false;
value_range vr2 = get_vr_for_comparison (i2);