aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-12-05 11:05:24 +0000
committerRichard Guenther <rguenther@suse.de>2011-12-05 11:05:24 +0000
commit061f423c3ace5daa1a99acc2c0cd3c67d835059e (patch)
tree0f669ecf9342c04f96e8d458fdd867ca990946be /gcc/tree-ssa.c
parent6242a598737514847d6ffec5aaf42e28e02fce11 (diff)
2011-12-05 Richard Guenther <rguenther@suse.de>
* tree-ssa.c (verify_ssa): Verify SSA names in the loop over all SSA names. Remove SSA operand checking, call verify_ssa_operands. * tree-ssa-operands.h (verify_ssa_operands): Declare. * tree-ssa-operands.c (verify_ssa_operands): New function. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@182007 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c89
1 files changed, 7 insertions, 82 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 8485af0a165..c28167e41aa 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -938,6 +938,8 @@ verify_ssa (bool check_modified_stmt)
gimple stmt;
TREE_VISITED (name) = 0;
+ verify_ssa_name (name, !is_gimple_reg (name));
+
stmt = SSA_NAME_DEF_STMT (name);
if (!gimple_nop_p (stmt))
{
@@ -987,9 +989,6 @@ verify_ssa (bool check_modified_stmt)
{
gimple stmt = gsi_stmt (gsi);
use_operand_p use_p;
- bool has_err;
- int count;
- unsigned i;
if (check_modified_stmt && gimple_modified_p (stmt))
{
@@ -999,89 +998,15 @@ verify_ssa (bool check_modified_stmt)
goto err;
}
- if (is_gimple_assign (stmt)
- && TREE_CODE (gimple_assign_lhs (stmt)) != SSA_NAME)
- {
- tree lhs, base_address;
-
- lhs = gimple_assign_lhs (stmt);
- base_address = get_base_address (lhs);
-
- if (base_address
- && SSA_VAR_P (base_address)
- && !gimple_vdef (stmt)
- && optimize > 0)
- {
- error ("statement makes a memory store, but has no VDEFS");
- print_gimple_stmt (stderr, stmt, 0, TDF_VOPS);
- goto err;
- }
- }
- else if (gimple_debug_bind_p (stmt)
- && !gimple_debug_bind_has_value_p (stmt))
- continue;
-
- /* Verify the single virtual operand and its constraints. */
- has_err = false;
- if (gimple_vdef (stmt))
- {
- if (gimple_vdef_op (stmt) == NULL_DEF_OPERAND_P)
- {
- error ("statement has VDEF operand not in defs list");
- has_err = true;
- }
- if (!gimple_vuse (stmt))
- {
- error ("statement has VDEF but no VUSE operand");
- has_err = true;
- }
- else if (SSA_NAME_VAR (gimple_vdef (stmt))
- != SSA_NAME_VAR (gimple_vuse (stmt)))
- {
- error ("VDEF and VUSE do not use the same symbol");
- has_err = true;
- }
- has_err |= verify_ssa_name (gimple_vdef (stmt), true);
- }
- if (gimple_vuse (stmt))
+ if (verify_ssa_operands (stmt))
{
- if (gimple_vuse_op (stmt) == NULL_USE_OPERAND_P)
- {
- error ("statement has VUSE operand not in uses list");
- has_err = true;
- }
- has_err |= verify_ssa_name (gimple_vuse (stmt), true);
- }
- if (has_err)
- {
- error ("in statement");
- print_gimple_stmt (stderr, stmt, 0, TDF_VOPS|TDF_MEMSYMS);
+ print_gimple_stmt (stderr, stmt, 0, TDF_VOPS);
goto err;
}
- count = 0;
- FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE|SSA_OP_DEF)
- {
- if (verify_ssa_name (op, false))
- {
- error ("in statement");
- print_gimple_stmt (stderr, stmt, 0, TDF_VOPS|TDF_MEMSYMS);
- goto err;
- }
- count++;
- }
-
- for (i = 0; i < gimple_num_ops (stmt); i++)
- {
- op = gimple_op (stmt, i);
- if (op && TREE_CODE (op) == SSA_NAME && --count < 0)
- {
- error ("number of operands and imm-links don%'t agree"
- " in statement");
- print_gimple_stmt (stderr, stmt, 0, TDF_VOPS|TDF_MEMSYMS);
- goto err;
- }
- }
+ if (gimple_debug_bind_p (stmt)
+ && !gimple_debug_bind_has_value_p (stmt))
+ continue;
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE|SSA_OP_VUSE)
{