Fix possible sanopt compile-time hog
authorRichard Biener <rguenther@suse.de>
Tue, 14 Feb 2023 15:14:51 +0000 (16:14 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 15 Feb 2023 07:28:48 +0000 (08:28 +0100)
commit86bc0909613e19e284b40fce9f9914e3a115bbe8
tree850524450cb6e557627733d0f7ec34513d4074ce
parente1dfac7e71056e879f101fef1c5ecb8ff6be1a1f
Fix possible sanopt compile-time hog

While working on bitmap operations I figured sanopt.cc uses
a sbitmap worklist, iterating using bitmap_first_set_bit on it.
That's quadratic since bitmap_first_set_bit for sbitmap is O(n).

The fix is to use regular bitmaps for the worklist and the bitmap
feeding it and to avoid a useless copy.

* sanopt.cc (sanitize_asan_mark_unpoison): Use bitmap
for with_poison and alias worklist to it.
(sanitize_asan_mark_poison): Likewise.
gcc/sanopt.cc