diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-14 14:21:41 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-14 14:21:41 +0000 |
commit | 3a23a641423aed45840766437d4553c1a8795eba (patch) | |
tree | 21ef4ec05b828e6f1466e7a77d7a896095ce86bf /gcc/tree-ssa-operands.c | |
parent | 8d3084712d0671a75e1d6ea677b7dfd4a8828a41 (diff) | |
download | gcc-3a23a641423aed45840766437d4553c1a8795eba.tar.gz |
2007-12-14 Richard Guenther <rguenther@suse.de>
PR middle-end/34462
* tree-ssa-operands.h (create_ssa_artificial_load_stmt): Add
parameter to say whether to unlink immediate uses.
* tree-ssa-operands.c (create_ssa_artificial_load_stmt): Do not
mark the artificial stmt as modified. Unlink immediate uses
only if requested.
* tree-ssa-dom.c (record_equivalences_from_stmt): Update caller.
* tree-ssa-pre.c (insert_fake_stores): Likewise.
* gcc.c-torture/compile/20071214-1.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130931 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r-- | gcc/tree-ssa-operands.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index fb611664c09..72f44338b2d 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -2647,17 +2647,23 @@ copy_virtual_operands (tree dest, tree src) create an artificial stmt which looks like a load from the store, this can be used to eliminate redundant loads. OLD_OPS are the operands from the store stmt, and NEW_STMT is the new load which represents a load of the - values stored. */ + values stored. If DELINK_IMM_USES_P is specified, the immediate + uses of this stmt will be de-linked. */ void -create_ssa_artificial_load_stmt (tree new_stmt, tree old_stmt) +create_ssa_artificial_load_stmt (tree new_stmt, tree old_stmt, + bool delink_imm_uses_p) { tree op; ssa_op_iter iter; use_operand_p use_p; unsigned i; + stmt_ann_t ann; - get_stmt_ann (new_stmt); + /* Create the stmt annotation but make sure to not mark the stmt + as modified as we will build operands ourselves. */ + ann = get_stmt_ann (new_stmt); + ann->modified = 0; /* Process NEW_STMT looking for operands. */ start_ssa_stmt_operands (); @@ -2687,8 +2693,9 @@ create_ssa_artificial_load_stmt (tree new_stmt, tree old_stmt) finalize_ssa_stmt_operands (new_stmt); /* All uses in this fake stmt must not be in the immediate use lists. */ - FOR_EACH_SSA_USE_OPERAND (use_p, new_stmt, iter, SSA_OP_ALL_USES) - delink_imm_use (use_p); + if (delink_imm_uses_p) + FOR_EACH_SSA_USE_OPERAND (use_p, new_stmt, iter, SSA_OP_ALL_USES) + delink_imm_use (use_p); } |