]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR c++/82081 - tail call optimization breaks noexcept
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Apr 2019 17:27:13 +0000 (17:27 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Apr 2019 17:27:13 +0000 (17:27 +0000)
commitb42bc85ab817517484ec3741662c9ad6467eb7ee
tree3c9963eb4dd5887df09070c5d7199822d305c7d4
parentad9db543abb523cd97f1aa5af78a72188c01aa6e
PR c++/82081 - tail call optimization breaks noexcept

If a noexcept function calls a function that might throw, doing the tail
call optimization means that an exception thrown in the called function
will propagate out, breaking the noexcept specification.  So we need to
prevent the optimization in that case.

* tree-tailcall.c (find_tail_calls): Don't turn a call from a
nothrow function to a might-throw function into a tail call.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270656 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/tail-call-1.C [new file with mode: 0644]
gcc/tree-tailcall.c