From: Richard Guenther Date: Fri, 9 Sep 2011 10:31:10 +0000 (+0000) Subject: tree-ssa-operands.c (swap_tree_operands): Always adjust existing operand positions. X-Git-Tag: releases/gcc-4.7.0~3840 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=64d9cb054e8153852901aee359b62bca5e4c2a67;p=thirdparty%2Fgcc.git tree-ssa-operands.c (swap_tree_operands): Always adjust existing operand positions. 2011-09-09 Richard Guenther * tree-ssa-operands.c (swap_tree_operands): Always adjust existing operand positions. From-SVN: r178723 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d04c2e94ea3e..aadfd7d963cc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-09-09 Richard Guenther + + * tree-ssa-operands.c (swap_tree_operands): Always adjust + existing operand positions. + 2011-09-09 Richard Guenther PR middle-end/50333 diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 995341f0e698..f27d5f0e6c09 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. */