From: Richard Biener <richard.guenther@gmail.com>
To: gcc-patches@gcc.gnu.org,Eric Botcazou <ebotcazou@adacore.com>
Subject: Re: [patch] Fix EH breakage in LTO mode
Date: Thu, 09 Nov 2017 16:51:00 -0000 [thread overview]
Message-ID: <4994C60C-6696-4D95-88EA-DF9D93F3D059@gmail.com> (raw)
In-Reply-To: <1568718.AUOz7rQ1P4@polaris>
On November 9, 2017 5:11:39 PM GMT+01:00, Eric Botcazou <ebotcazou@adacore.com> wrote:
>Hi,
>
>the patch
>
>2017-07-06 Jan Hubicka <hubicka@ucw.cz>
>
> * 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
>-funwind-tables or -fasynchronous-unwind-tables (i.e not x86) and do
>not
>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
>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
>to 0 and they are reset to 0 through optimization_default_node after
>the last
>function is processed by the cgraph machinery.
>
>Note that flag_exceptions is generally set to 1 in lto_init_eh very
>early, but
>the above mechanism overrides it. However, flag_exceptions may *never*
>be set
>to 1 for a specific partition if it contains only EH-neutral functions;
>that's
>why I think that there is no other way than restoring the build-wide
>handling
>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.
Richard.
>
>2017-11-09 Eric Botcazou <ebotcazou@adacore.com>
>
> * 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.
next prev parent reply other threads:[~2017-11-09 16:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 16:39 Eric Botcazou
2017-11-09 16:51 ` Richard Biener [this message]
2017-11-09 17:17 ` Jan Hubicka
2017-11-09 17:20 ` Eric Botcazou
2017-11-09 18:12 ` Jan Hubicka
2017-11-09 20:03 ` Richard Biener
2017-11-09 23:43 ` Eric Botcazou
2017-11-09 18:03 ` Rainer Orth
2017-11-09 23:39 ` Eric Botcazou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4994C60C-6696-4D95-88EA-DF9D93F3D059@gmail.com \
--to=richard.guenther@gmail.com \
--cc=ebotcazou@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).