tree-optimization/105173 - fix insertion logic in reassoc
authorRichard Biener <rguenther@suse.de>
Wed, 6 Apr 2022 09:43:01 +0000 (11:43 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 6 Apr 2022 11:15:35 +0000 (13:15 +0200)
commite1a5e7562d53a8d2256f754714b06595bea72196
tree885d2af63d488361b01ba5ca6d73b9df57257b8e
parent4be08315124281f4e9359bc7e5279a99bdbdd053
tree-optimization/105173 - fix insertion logic in reassoc

The find_insert_point logic around deciding whether to insert
before or after the found insertion point does not handle
the case of _12 = ..;, _12, 1.0 well.  The following puts the
logic into find_insert_point itself instead.

2022-04-06  Richard Biener  <rguenther@suse.de>

PR tree-optimization/105173
* tree-ssa-reassoc.cc (find_insert_point): Get extra
insert_before output argument and compute it.
(insert_stmt_before_use): Adjust.
(rewrite_expr_tree): Likewise.

* gcc.dg/pr105173.c: New testcase.
gcc/testsuite/gcc.dg/pr105173.c [new file with mode: 0644]
gcc/tree-ssa-reassoc.cc