PR middle-end/38533
* tree-ssa-reassoc.c (remove_visited_stmt_chain): New function.
(rewrite_expr_tree): Add moved argument, move stmts together if
needed. Call remove_visited_stmt_chain.
(linearize_expr_tree): Don't move stmts here.
(reassociate_bb): Call remove_visited_stmt_chain if num ops is 1.
Adjust rewrite_expr_tree caller.
* gcc.dg/tree-ssa/pr38533.c: New test.
* gcc.c-torture/execute/pr38533.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142807
138bc75d-0d04-0410-961f-
82ee72b054a4