aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 16f85f5..9202f04 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -938,6 +938,8 @@ 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))
{
@@ -1007,6 +1009,7 @@ verify_ssa (bool check_modified_stmt)
goto err;
}
+ count = 0;
FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE|SSA_OP_DEF)
{
if (verify_ssa_name (op, false))
@@ -1015,6 +1018,19 @@ verify_ssa (bool check_modified_stmt)
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 ("nr of operands and imm-links doesn't agree");
+ error ("in statement");
+ print_gimple_stmt (stderr, stmt, 0, TDF_VOPS|TDF_MEMSYMS);
+ goto err;
+ }
}
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE|SSA_OP_VUSE)