c++: enable -fdelete-dead-exceptions by default
commitb15e301748f0e042379909e32b3ade439dd8f8f9
authorJason Merrill <jason@redhat.com>
Fri, 9 Jul 2021 09:45:03 +0000 (9 05:45 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 14 Jul 2021 18:59:56 +0000 (14 14:59 -0400)
tree16cda41375af0b9e2b0f01c9c8305ac7d4f28f9d
parent4940166a15193d6583b320f2957af8720745b76c
c++: enable -fdelete-dead-exceptions by default

As I was discussing with richi, I don't think it makes sense to protect
calls to pure/const functions from DCE just because they aren't explicitly
declared noexcept.  PR100382 indicates that there are different
considerations for Go, which has non-call exceptions.  But still turn the
flag off for that specific testcase.

gcc/c-family/ChangeLog:

* c-opts.c (c_common_post_options): Set -fdelete-dead-exceptions.

gcc/ChangeLog:

* doc/invoke.texi: -fdelete-dead-exceptions is on by default for
C++.

gcc/testsuite/ChangeLog:

* g++.dg/torture/pr100382.C: Pass -fno-delete-dead-exceptions.
gcc/c-family/c-opts.c
gcc/doc/invoke.texi
gcc/testsuite/g++.dg/torture/pr100382.C