diff options
author | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-11 22:06:46 +0000 |
---|---|---|
committer | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-11 22:06:46 +0000 |
commit | ee36b91530f2dd72acb5a204a445ff1f417d2505 (patch) | |
tree | ea3a6eedbf40f8febad0a55f21fd8d5f0af2123d /gcc/tree-ssa.c | |
parent | a5ac7fc326df28a68d0147a5203839762d5de30c (diff) | |
download | gcc-ee36b91530f2dd72acb5a204a445ff1f417d2505.tar.gz |
PR tree-optimization/20933
* tree-ssa-alias.c (compute_flow_insensitive_aliasing): Move
logic to reject aliases between read-only and writable
variables ...
(may_alias_p): ... here.
(get_tmt_for): Do not associate read-only tags to pointers
whose pointed-to type is not read-only.
* tree-ssa.c (verify_ssa): Check that memory stores have at
least one V_MAY_DEF or V_MUST_DEF.
testsuite/ChangeLog
PR tree-optimization/20933
* gcc.dg/tree-ssa/pr20933.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97988 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r-- | gcc/tree-ssa.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index c152f824afe..1e232e392e5 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -707,16 +707,37 @@ verify_ssa (bool check_modified_stmt) goto err; } + if (TREE_CODE (stmt) == MODIFY_EXPR + && TREE_CODE (TREE_OPERAND (stmt, 0)) != SSA_NAME) + { + tree lhs, base_address; + + lhs = TREE_OPERAND (stmt, 0); + base_address = get_base_address (lhs); - if (stmt_ann (stmt)->makes_aliased_stores - && NUM_V_MAY_DEFS (STMT_V_MAY_DEF_OPS (stmt)) == 0) + if (base_address + && SSA_VAR_P (base_address) + && NUM_V_MAY_DEFS (STMT_V_MAY_DEF_OPS (stmt)) == 0 + && NUM_V_MUST_DEFS (STMT_V_MUST_DEF_OPS (stmt)) == 0) { - error ("Statement makes aliased stores, but has no V_MAY_DEFS"); + error ("Statement makes a memory store, but has no " + "V_MAY_DEFS nor V_MUST_DEFS"); print_generic_stmt (stderr, stmt, TDF_VOPS); goto err; } + } + + + if (stmt_ann (stmt)->makes_aliased_stores + && NUM_V_MAY_DEFS (STMT_V_MAY_DEF_OPS (stmt)) == 0) + { + error ("Statement makes aliased stores, but has no V_MAY_DEFS"); + print_generic_stmt (stderr, stmt, TDF_VOPS); + goto err; + } - FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES | SSA_OP_ALL_KILLS) + FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, + SSA_OP_ALL_USES | SSA_OP_ALL_KILLS) { op = USE_FROM_PTR (use_p); if (verify_use (bb, definition_block[SSA_NAME_VERSION (op)], |