Avoid visiting newly-created blocks in harden-conditionals
authorAlexandre Oliva <oliva@adacore.com>
Fri, 13 May 2022 10:48:51 +0000 (07:48 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Fri, 13 May 2022 10:48:51 +0000 (07:48 -0300)
commit04c0a88aabe8f73f87d6b756aaa0925e58229c99
treeb04ef9a67a67e6f519d2f252fbe2f12c6a339a2f
parent6aaa1d573912828efed1514fbec5e1ef8a7cc3bc
Avoid visiting newly-created blocks in harden-conditionals

Reverse iteration over blocks, in gimple-harden-conditionals.cc, was
supposed to avoid visiting blocks introduced by hardening and
introducing further reversed conditionals and traps for them, but
newly-created blocks may be inserted before the current block, as
shown by the PR105455 testcase.

Use an auto_sbitmap to gather preexisting blocks that need visiting.

for  gcc/ChangeLog

* gimple-harden-conditionals.cc: Include sbitmap.h.
(pass_harden_conditional_branches::execute): Skip new blocks.
(pass_harden_compares::execute): Likewise.
gcc/gimple-harden-conditionals.cc