diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-09 10:31:10 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-09 10:31:10 +0000 |
commit | f3f02af06ab408fc6859d7b151b8de4554289044 (patch) | |
tree | dbbcb5ce68eb29cfa86f1f716a9c053f24079923 /gcc/tree-ssa-operands.c | |
parent | 32246fd413dba3cbeb133f3c95d29b321a073174 (diff) | |
download | gcc-f3f02af06ab408fc6859d7b151b8de4554289044.tar.gz |
2011-09-09 Richard Guenther <rguenther@suse.de>
* tree-ssa-operands.c (swap_tree_operands): Always adjust
existing operand positions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178723 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, 8 insertions, 9 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 995341f0e69..f27d5f0e6c0 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -1149,7 +1149,8 @@ swap_tree_operands (gimple stmt, tree *exp0, tree *exp1) /* If the operand cache is active, attempt to preserve the relative positions of these two operands in their respective immediate use - lists. */ + lists by adjusting their use pointer to point to the new + operand position. */ if (ssa_operands_active () && op0 != op1) { use_optype_p use0, use1, ptr; @@ -1170,14 +1171,12 @@ swap_tree_operands (gimple stmt, tree *exp0, tree *exp1) break; } - /* If both uses don't have operand entries, there isn't much we can do - at this point. Presumably we don't need to worry about it. */ - if (use0 && use1) - { - tree *tmp = USE_OP_PTR (use1)->use; - USE_OP_PTR (use1)->use = USE_OP_PTR (use0)->use; - USE_OP_PTR (use0)->use = tmp; - } + /* And adjust their location to point to the new position of the + operand. */ + if (use0) + USE_OP_PTR (use0)->use = exp1; + if (use1) + USE_OP_PTR (use1)->use = exp0; } /* Now swap the data. */ |