From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84728 invoked by alias); 9 Nov 2017 16:39:43 -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 84717 invoked by uid 89); 9 Nov 2017 16:39:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=HTo:U*ebotcazou X-HELO: mail-wm0-f46.google.com Received: from mail-wm0-f46.google.com (HELO mail-wm0-f46.google.com) (74.125.82.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Nov 2017 16:39:41 +0000 Received: by mail-wm0-f46.google.com with SMTP id s66so18299830wmf.5 for ; Thu, 09 Nov 2017 08:39:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=lPjio9k0+By0iFIkjZ9YUNMo50z4g+yge8vY77usf14=; b=RrzQs7u1owxzBjXLlswL9IVwYduX7crjPlTx6wJwuzJm1Xxs5fl9ZQoxxBclKKvIWs PKYVfnWdQ13Ceu0KW+KGyJ+U8PUEp3s7ulqi3E/KVSFuQ+nv9sKNfmEsjTAeoAXxh0Rj ymdzcMcP4R5a7TpFBej3fmW61EHvuvO9/UAwf5F5AtOqAxqkhioMtvygiJmCzd4buAz3 Lh5Tg9jRSqFiE8CtNq6Bab0vNdB4AOH+FM53UpXaMGNnamsdq6OtWJutgks5ItZR906X x2NPfAGp5/hCPl67KyyCxMGZ/uM2I1nb2rd5ygnK3LjNcy9N4qFljb4BgtH/dhlW7y4p BFJg== X-Gm-Message-State: AJaThX5DBAvk6w3naw5qbj6PdhPHUut3vGbZyghswqn6sW3oNId/Zcc/ 04+lCZRCL4ZyKrgkQy9WxON4joYK X-Google-Smtp-Source: AGs4zMaXPUMir86wf9ynFll6MdKDJT+ERWjO7DlFh66/LefS/LDYDCJ2egUfUwqIvWoC+5rqS6iAXw== X-Received: by 10.28.148.15 with SMTP id w15mr345735wmd.140.1510245579450; Thu, 09 Nov 2017 08:39:39 -0800 (PST) Received: from android-97b5c0ce9bfced28.fritz.box (p5494E455.dip0.t-ipconnect.de. [84.148.228.85]) by smtp.gmail.com with ESMTPSA id f140sm5606945wmd.27.2017.11.09.08.39.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2017 08:39:38 -0800 (PST) Date: Thu, 09 Nov 2017 16:51:00 -0000 User-Agent: K-9 Mail for Android In-Reply-To: <1568718.AUOz7rQ1P4@polaris> References: <1568718.AUOz7rQ1P4@polaris> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [patch] Fix EH breakage in LTO mode To: gcc-patches@gcc.gnu.org,Eric Botcazou From: Richard Biener Message-ID: <4994C60C-6696-4D95-88EA-DF9D93F3D059@gmail.com> X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00776.txt.bz2 On November 9, 2017 5:11:39 PM GMT+01:00, Eric Botcazou wrote: >Hi, > >the patch > >2017-07-06 Jan Hubicka > > * lto-wrapper.c (merge_and_complain): Do not merge > fexceptions, fnon_call_exceptions, ftrapv, ffp_contract_, fmath_errno, > fsigned_zeros, ftrapping_math, fwrapv. > (append_compiler_options): Do not track these options. > (append_linker_options): Likewie > >has broken exception handling in LTO mode for targets which don't force >either=20 >-funwind-tables or -fasynchronous-unwind-tables (i.e not x86) and do >not=20 >default to -fdwarf2-cfi-asm (i.e. not Linux), for example >SPARC/Solaris. > >The problem is that the eh_frame section is no longer generated because >it is=20 >emitted from compile_file: > > #if defined DWARF2_DEBUGGING_INFO || defined DWARF2_UNWIND_INFO > if (dwarf2out_do_frame ()) > dwarf2out_frame_finish (); > #endif > >and this requires that either flag_unwind_tables or flag_exceptions be >set. > >But both -funwind-tables and -fexceptions are optimization options >defaulting=20 >to 0 and they are reset to 0 through optimization_default_node after >the last=20 >function is processed by the cgraph machinery. > >Note that flag_exceptions is generally set to 1 in lto_init_eh very >early, but=20 >the above mechanism overrides it. However, flag_exceptions may *never* >be set=20 >to 1 for a specific partition if it contains only EH-neutral functions; >that's=20 >why I think that there is no other way than restoring the build-wide >handling=20 >of -fexceptions before Jan's patch (hopefully it's the only affected >switch). > >Tested (lightly for now) on x86-64/Linux and SPARC/Solaris, OK for >mainline? OK.=20 Richard.=20 > >2017-11-09 Eric Botcazou > > * lto-opts.c (lto_write_options): Do not save -fnon-call-exceptions, > -ffp-contract, -fmath-errno, -fsigned-zeros, -ftrapping-math, -ftrapv > and -fwrapv. > * lto-wrapper.c (merge_and_complain): Merge again -fexceptions. > (append_compiler_options): Pass again -fexceptions.