public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Andreas Schwab <schwab@suse.de>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] lto: pass through -funwind-tables and -fasynchronous-unwind-tables
Date: Wed, 25 Jan 2023 14:16:26 +0100	[thread overview]
Message-ID: <CAFiYyc2GmxHYHM1Wt2HwyGM9zJvspfYiSwOrBWD6odfoAhVmwA@mail.gmail.com> (raw)
In-Reply-To: <mvmlem0ywoy.fsf@suse.de>

On Wed, Jan 18, 2023 at 11:17 AM Andreas Schwab via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> The -funwind-tables and -fasynchronous-unwind-tables options are relevant
> for the output pass, thus they need to be passed through by the lto
> wrapper.
>
> gcc/
>         * lto-wrapper.cc (merge_and_complain): Pass through
>         -funwind-tables and -fasynchronous-unwind-tables.
>         (append_compiler_options): Likewise.
> ---
>  gcc/lto-wrapper.cc | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/gcc/lto-wrapper.cc b/gcc/lto-wrapper.cc
> index 11c4d1b38a4..627e8238606 100644
> --- a/gcc/lto-wrapper.cc
> +++ b/gcc/lto-wrapper.cc
> @@ -314,6 +314,8 @@ merge_and_complain (vec<cl_decoded_option> &decoded_options,
>         case OPT_fshow_column:
>         case OPT_fcommon:
>         case OPT_fgnu_tm:
> +       case OPT_funwind_tables:
> +       case OPT_fasynchronous_unwind_tables:
>         case OPT_g:
>           /* Do what the old LTO code did - collect exactly one option
>              setting per OPT code, we pick the first we encounter.

A better place is

        case OPT_fopenmp:
        case OPT_fopenacc:
          /* For selected options we can merge conservatively.  */
          if (existing_opt == -1)
            decoded_options.safe_push (*foption);
          /* -fopenmp > -fno-openmp,
             -fopenacc > -fno-openacc  */
          else if (foption->value > decoded_options[existing_opt].value)
            decoded_options[existing_opt] = *foption;
          break;

where we'd prefer -funwind-tables over -fno-unwind-tables when the
options do not match
across TUs.  Note that you likely want to add
-f[asynchronous-]unwind-tables handling
in lto-options.cc:lto_write_options as well so the default is streamed
as explicit option.
Otherwise a single TU with -fno-unwind-tables on x86-64 would cause
the whole LTO
compilation to be built without.

> @@ -737,6 +739,8 @@ append_compiler_options (obstack *argv_obstack, vec<cl_decoded_option> opts)
>         case OPT_fopenacc_dim_:
>         case OPT_foffload_abi_:
>         case OPT_fcf_protection_:
> +       case OPT_funwind_tables:
> +       case OPT_fasynchronous_unwind_tables:
>         case OPT_g:
>         case OPT_O:
>         case OPT_Ofast:
> --
> 2.39.1
>
>
> --
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."

  parent reply	other threads:[~2023-01-25 13:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 10:16 Andreas Schwab
2023-01-18 11:05 ` Richard Biener
2023-01-18 11:25   ` Andreas Schwab
2023-01-18 11:31     ` Jakub Jelinek
2023-01-18 12:30       ` Andreas Schwab
2023-01-18 12:35         ` Jakub Jelinek
2023-01-18 12:39           ` Andreas Schwab
2023-01-18 12:47             ` Jakub Jelinek
2023-01-18 13:00               ` Andreas Schwab
2023-01-18 14:03                 ` Michael Matz
2023-01-18 14:14                   ` Andreas Schwab
2023-01-18 14:25                     ` Jakub Jelinek
2023-01-18 15:11                       ` Andreas Schwab
2023-01-18 14:27                   ` Jakub Jelinek
2023-01-18 15:09                     ` Andreas Schwab
2023-01-18 15:11                       ` Jakub Jelinek
2023-01-18 15:16                         ` Michael Matz
2023-01-18 15:19                           ` Jakub Jelinek
2023-01-18 15:32                             ` Michael Matz
2023-01-18 16:09                               ` Andreas Schwab
2023-01-18 16:25                                 ` Jan Hubicka
2023-01-18 16:28                                   ` Jakub Jelinek
2023-01-18 15:07                 ` Jan Hubicka
2023-01-19  7:14                   ` Richard Biener
2023-01-18 13:36               ` Andreas Schwab
2023-01-25 13:16 ` Richard Biener [this message]
2023-01-25 13:50   ` Andreas Schwab

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=CAFiYyc2GmxHYHM1Wt2HwyGM9zJvspfYiSwOrBWD6odfoAhVmwA@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=schwab@suse.de \
    /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).