aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-01-19 12:00:42 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-01-19 12:00:42 +0000
commited20a004e1fe1423e1e6fb2b47a3aeeb5c5a71ab (patch)
treefe6bd0f7fea026e472399bddbda7229a229da268 /gcc
parent4f94fa1186d071b2f4b5d864acb4b0427cb63368 (diff)
downloadgcc-ed20a004e1fe1423e1e6fb2b47a3aeeb5c5a71ab.zip
gcc-ed20a004e1fe1423e1e6fb2b47a3aeeb5c5a71ab.tar.gz
gcc-ed20a004e1fe1423e1e6fb2b47a3aeeb5c5a71ab.tar.bz2
re PR rtl-optimization/72488 (wrong code (SIGFPE) at -Os and above on x86_64-linux-gnu (in the 64-bit mode))
2017-01-19 Richard Biener <rguenther@suse.de> PR tree-optimization/72488 * tree-ssa-sccvn.c (run_scc_vn): When we abort the VN make sure to restore SSA info. * tree-ssa.c (verify_ssa): Verify SSA info is not shared. From-SVN: r244623
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/tree-ssa-sccvn.c1
-rw-r--r--gcc/tree-ssa.c55
3 files changed, 48 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bb725d6..20b703f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2017-01-19 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/72488
+ * tree-ssa-sccvn.c (run_scc_vn): When we abort the VN make
+ sure to restore SSA info.
+ * tree-ssa.c (verify_ssa): Verify SSA info is not shared.
+
2017-01-19 Richard Earnshaw <rearnsha@arm.com>
PR rtl-optimization/79121
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 97e17bb..8a9fff5 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -4844,6 +4844,7 @@ run_scc_vn (vn_lookup_kind default_vn_walk_kind_)
walker.walk (ENTRY_BLOCK_PTR_FOR_FN (cfun));
if (walker.fail)
{
+ scc_vn_restore_ssa_info ();
free_scc_vn ();
return false;
}
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 605ee0f..067143f 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1027,24 +1027,49 @@ verify_ssa (bool check_modified_stmt, bool check_ssa_operands)
timevar_push (TV_TREE_SSA_VERIFY);
- /* Keep track of SSA names present in the IL. */
- size_t i;
- tree name;
-
- FOR_EACH_SSA_NAME (i, name, cfun)
{
- gimple *stmt;
- TREE_VISITED (name) = 0;
-
- verify_ssa_name (name, virtual_operand_p (name));
+ /* Keep track of SSA names present in the IL. */
+ size_t i;
+ tree name;
+ hash_map <void *, tree> ssa_info;
- stmt = SSA_NAME_DEF_STMT (name);
- if (!gimple_nop_p (stmt))
+ FOR_EACH_SSA_NAME (i, name, cfun)
{
- basic_block bb = gimple_bb (stmt);
- if (verify_def (bb, definition_block,
- name, stmt, virtual_operand_p (name)))
- goto err;
+ gimple *stmt;
+ TREE_VISITED (name) = 0;
+
+ verify_ssa_name (name, virtual_operand_p (name));
+
+ stmt = SSA_NAME_DEF_STMT (name);
+ if (!gimple_nop_p (stmt))
+ {
+ basic_block bb = gimple_bb (stmt);
+ if (verify_def (bb, definition_block,
+ name, stmt, virtual_operand_p (name)))
+ goto err;
+ }
+
+ void *info = NULL;
+ if (POINTER_TYPE_P (TREE_TYPE (name)))
+ info = SSA_NAME_PTR_INFO (name);
+ else if (INTEGRAL_TYPE_P (TREE_TYPE (name)))
+ info = SSA_NAME_RANGE_INFO (name);
+ if (info)
+ {
+ bool existed;
+ tree &val = ssa_info.get_or_insert (info, &existed);
+ if (existed)
+ {
+ error ("shared SSA name info");
+ print_generic_expr (stderr, val, 0);
+ fprintf (stderr, " and ");
+ print_generic_expr (stderr, name, 0);
+ fprintf (stderr, "\n");
+ goto err;
+ }
+ else
+ val = name;
+ }
}
}