diff options
author | matz <matz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-03 14:42:46 +0000 |
---|---|---|
committer | matz <matz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-03 14:42:46 +0000 |
commit | 8c6d6f5a43bf1d3cc5de4e3c9e199447d8b8e4b8 (patch) | |
tree | aa614bb1c0bc6ea02ae1dfcf2d8530766219c8ee /gcc/tree-ssa.c | |
parent | 65cb92cdf7763739dbbc9144af32c389eee1ada1 (diff) | |
download | gcc-8c6d6f5a43bf1d3cc5de4e3c9e199447d8b8e4b8.tar.gz |
PR middle-end/45415
* tree-sra.c (sra_modify_assign): If we modify the statement,
say so.
* tree-ssa.c (verify_ssa): Check number of operands and links
per statement to agree.
testsuite/
PR middle-end/45415
* gcc.dg/pr45415.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163822 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r-- | gcc/tree-ssa.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index 16f85f5d868..9202f049670 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) |