From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31733 invoked by alias); 8 Nov 2019 00:07:49 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 31676 invoked by uid 89); 8 Nov 2019 00:07:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=H*r:encrypted, customers, H*r:sk:mailout, H*RU:sk:mailout X-HELO: mailout12.t-online.de Received: from mailout12.t-online.de (HELO mailout12.t-online.de) (194.25.134.22) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Nov 2019 00:07:47 +0000 Received: from fwd26.aul.t-online.de (fwd26.aul.t-online.de [172.20.26.131]) by mailout12.t-online.de (Postfix) with SMTP id 810D441BC51E; Fri, 8 Nov 2019 01:07:44 +0100 (CET) Received: from yam-desktop (Eez9w6Z6rhrZcYQzeW935HqmNvP6XtPVvwS5XTkhr5OQ73kOwGOwM-dHFOVAbqaZ7K@[163.58.16.102]) by fwd26.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1iSroV-3ADUi80; Fri, 8 Nov 2019 01:07:43 +0100 Message-ID: <8b705a60e10ebf94e432476bb6b738b8fec09094.camel@t-online.de> Subject: Re: [PATCH 2/4] MSP430: Disable exception handling by default for C++ From: Oleg Endo To: Jozef Lawrynowicz , "gcc-patches@gcc.gnu.org" Date: Fri, 08 Nov 2019 00:07:00 -0000 In-Reply-To: <20191107213727.731656fe@jozef-kubuntu> References: <20191107213110.0ceea63a@jozef-kubuntu> <20191107213727.731656fe@jozef-kubuntu> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-11/txt/msg00565.txt.bz2 On Thu, 2019-11-07 at 21:37 +0000, Jozef Lawrynowicz wrote: > The code size bloat added by building C++ programs using libraries containing > support for exceptions is significant. When using simple constructs such as > static variables, sometimes many kB from the libraries are unnecessarily > pulled in. > > So this patch disable exceptions by default for MSP430 when compiling for C++, > by implicitly passing -fno-exceptions unless -fexceptions is passed. It is extremely annoying when GCC's default standard behavior differs across different targets. And as a consequence, you have to add a load of workarounds and disable other things, like fiddling with the testsuite. It's the same thing as setting "double = float" to get more "speed" by default. I would strongly advice against making such non-standard behaviors the default in the vanilla compiler. C++ normally has exceptions enabled. If a user doesn't want them and is willing to deal with it all the consequences, then we already have a mechanism to do that: --fno-exceptions Perhaps it's generally more useful to add a global configure option for GCC to disable exception handling by default. Then you can provide a turn-key toolchain to your customers as well -- just add an option to the configure line. Cheers, Oleg