]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-cfg: do not duplicate returns_twice calls
authorAlexander Monakov <amonakov@ispras.ru>
Fri, 14 Jan 2022 17:51:12 +0000 (20:51 +0300)
committerAlexander Monakov <amonakov@ispras.ru>
Tue, 19 Jul 2022 14:16:17 +0000 (17:16 +0300)
commit26cea5f108e0facdb080e385000bb141b086845f
treeff8fb6fd44e6609fcf03e6b331165cd38107246c
parent76c3f0dc2f815e0e450642efd5348c3ab852e4d0
tree-cfg: do not duplicate returns_twice calls

A returns_twice call may have associated abnormal edges that correspond
to the "second return" from the call. If the call is duplicated, the
copies of those edges also need to be abnormal, but e.g. tracer does not
enforce that. Just prohibit the (unlikely to be useful) duplication.

gcc/ChangeLog:

* cfghooks.cc (duplicate_block): Expand comment.
* tree-cfg.cc (gimple_can_duplicate_bb_p): Reject blocks with
calls that may return twice.
gcc/cfghooks.cc
gcc/tree-cfg.cc