This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/4] MSP430: Disable exception handling by default for C++
- From: Richard Sandiford <richard dot sandiford at arm dot com>
- To: Jozef Lawrynowicz <jozef dot l at mittosystems dot com>
- Cc: Oleg Endo <oleg dot endo at t-online dot de>, "gcc-patches at gcc dot gnu dot org\" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 12 Nov 2019 21:08:48 +0000
- Subject: Re: [PATCH 2/4] MSP430: Disable exception handling by default for C++
- References: <20191107213110.0ceea63a@jozef-kubuntu> <20191107213727.731656fe@jozef-kubuntu> <8b705a60e10ebf94e432476bb6b738b8fec09094.camel@t-online.de> <20191108132608.7a774581@jozef-kubuntu>
Jozef Lawrynowicz <jozef.l@mittosystems.com> writes:
> diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
> index 1df645e283c..1ce449cb935 100644
> --- a/gcc/testsuite/lib/gcc-dg.exp
> +++ b/gcc/testsuite/lib/gcc-dg.exp
> @@ -417,6 +417,16 @@ proc gcc-dg-prune { system text } {
> return "::unsupported::large return values"
> }
>
> + # If exceptions are disabled, mark tests expecting exceptions to be enabled
> + # as unsupported.
> + if [regexp "(^|\n)\[^\n\]*: error: exception handling disabled" $text] {
> + return "::unsupported::exception handling disabled"
> + }
This is probably safe, but...
> +
> + if [regexp "(^|\n)\[^\n\]*: error: #error .__cpp_exceptions." $text] {
> + return "::unsupported::exception handling disabled"
> + }
...it looks like this would disable g++.dg/cpp1y/feat-neg.C for all
targets. I assume this was motivated by g++.dg/cpp2a/feat-cxx2a.C,
but the kind of effective-target tests you had in the original patch
are probably better there. It might then be more robust to test that
[check_effective_target_...] for the "exception handling disabled" case
above as well, so that other targets aren't affected accidentally.
It'd be good to test a target/multilib that has exceptions enabled by
default to make sure there's no change in the number of unsupported
tests (rather than just no new fails).
Thanks,
Richard