diff options
author | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-10-16 12:42:41 +0000 |
---|---|---|
committer | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-10-16 12:42:41 +0000 |
commit | 9e8385f41ea0de46c7eea143098518f6aff7594d (patch) | |
tree | 5107f0c554e588bb3d6a6133f58e90df08dc10e8 /gcc/tree-into-ssa.c | |
parent | 1130105d35c9d312f6d1058dda54bdb9b370fb97 (diff) | |
download | gcc-9e8385f41ea0de46c7eea143098518f6aff7594d.tar.gz |
Assert no use with SSA_NAME_IN_FREELIST before using freelist.
2014-10-16 Tom de Vries <tom@codesourcery.com>
* tree-into-ssa.c (update_ssa): Assert that there's no ssa use operand
with SSA_NAME_IN_FREELIST.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216318 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-into-ssa.c')
-rw-r--r-- | gcc/tree-into-ssa.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c index 01203dece18..f1983f1ac73 100644 --- a/gcc/tree-into-ssa.c +++ b/gcc/tree-into-ssa.c @@ -3161,6 +3161,45 @@ update_ssa (unsigned update_flags) if (!need_ssa_update_p (cfun)) return; +#ifdef ENABLE_CHECKING + timevar_push (TV_TREE_STMT_VERIFY); + + bool err = false; + + FOR_EACH_BB_FN (bb, cfun) + { + gimple_stmt_iterator gsi; + for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) + { + gimple stmt = gsi_stmt (gsi); + + ssa_op_iter i; + use_operand_p use_p; + FOR_EACH_SSA_USE_OPERAND (use_p, stmt, i, SSA_OP_ALL_USES) + { + tree use = USE_FROM_PTR (use_p); + if (TREE_CODE (use) != SSA_NAME) + continue; + + if (SSA_NAME_IN_FREE_LIST (use)) + { + error ("statement uses released SSA name:"); + debug_gimple_stmt (stmt); + fprintf (stderr, "The use of "); + print_generic_expr (stderr, use, 0); + fprintf (stderr," should have been replaced\n"); + err = true; + } + } + } + } + + if (err) + internal_error ("cannot update SSA form"); + + timevar_pop (TV_TREE_STMT_VERIFY); +#endif + timevar_push (TV_TREE_SSA_INCREMENTAL); if (dump_file && (dump_flags & TDF_DETAILS)) |