public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Andreas Schwab <schwab@suse.de>
Cc: Michael Matz <matz@suse.de>,
	gcc-patches@gcc.gnu.org,
	Richard Biener <richard.guenther@gmail.com>,
	Jan Hubicka <hubicka@ucw.cz>
Subject: Re: [PATCH] lto: pass through -funwind-tables and -fasynchronous-unwind-tables
Date: Wed, 18 Jan 2023 15:25:23 +0100	[thread overview]
Message-ID: <Y8gBUy1/2a5tKBd9@tucnak> (raw)
In-Reply-To: <mvmilh4x74m.fsf@suse.de>

On Wed, Jan 18, 2023 at 03:14:01PM +0100, Andreas Schwab wrote:
> On Jan 18 2023, Michael Matz wrote:
> 
> > So, it's quite clear that the option merging algorithm related to all this 
> > is somewhat broken, the global (or per function, or whatever) 
> > -funwind-tables option from hello.o doesn't make it correctly into the 
> > output (when -g is there).  Adding -fexception makes it work because then 
> > the functions will have personalities and on LTO-read-in _that_ will 
> > implicitely enable funwind-tables again (which should have been enabled 
> > already by the option-read-in).
> 
> My guess is that flag_unwind_tables is not yet set when .cfi_sections is
> emitted (which is done by dwarf2out_assembly_start before compile starts).

Well, the primary question for PerFunction/Optimization flag is what such
flag means outside of any function.
Because with such flags, it no longer is everything wants unwind tables (or
asynchronous unwind tables), but perhaps some functions want that and others
don't.
So, do we for .cfi_sections want to know whether at least one of the
functions in the TU (or partition for lto1) wants unwind tables /
asynchronous unwind tables, or whether all of them do, something else?

That isn't specific to LTO btw, one can compile say:
-g -O2 -fasynchronous-unwind-tables -funwind-tables
__attribute__((optimize ("no-asynchronous-unwind-tables,no-unwind-tables"))) int foo (int x) { return x; }
__attribute__((optimize ("no-asynchronous-unwind-tables,no-unwind-tables"))) int bar (int x) { return x; }
or
-g -O2 -fno-asynchronous-unwind-tables -fno-unwind-tables
__attribute__((optimize ("asynchronous-unwind-tables,unwind-tables"))) int foo (int x) { return x; }
__attribute__((optimize ("asynchronous-unwind-tables,unwind-tables"))) int bar (int x) { return x; }
Now, for non-LTO what you get in flag_asynchronous_unwind_tables or
flag_unwind_tables when cfun is NULL is I think whatever has been
set on the command line (or defaulted), which doesn't need to match
any of the emitted functions.
For LTO we currently get there just whatever has been defaulted.
Neither of that will always match all the states of all the functions.

	Jakub


  reply	other threads:[~2023-01-18 14:25 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 [this message]
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
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=Y8gBUy1/2a5tKBd9@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=matz@suse.de \
    --cc=richard.guenther@gmail.com \
    --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).