tree-optimization/97806 - fix PRE expression post order
authorRichard Biener <rguenther@suse.de>
Thu, 12 Nov 2020 08:10:51 +0000 (09:10 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 12 Nov 2020 10:00:47 +0000 (11:00 +0100)
commit64326bb428ac750ec3b0f56c06dfb98277cd41b5
tree867d7df31bd9996baae428b7807299c238bfadde
parentfc531c2ed3ce456efca946e995544b216b3c16df
tree-optimization/97806 - fix PRE expression post order

This fixes the postorder compute for the case of multiple
expression leaders for a value.

2020-11-12  Richard Biener  <rguenther@suse.de>

PR tree-optimization/97806
* tree-ssa-pre.c (pre_expr_DFS): New overload for visiting
values, visiting all leaders for a value.  Use a bitmap
for visited values.
(sorted_array_from_bitmap_set): Walk over values and adjust.

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