[PATCH] rs6000: Enable -fasynchronous-unwind-tables by default

Jakub Jelinek jakub@redhat.com
Thu Apr 5 13:35:00 GMT 2018


On Thu, Apr 05, 2018 at 05:08:36AM -0500, Segher Boessenkool wrote:
> On Thu, Apr 05, 2018 at 11:50:38AM +0200, Jakub Jelinek wrote:
> > On Thu, Apr 05, 2018 at 09:45:54AM +0000, Segher Boessenkool wrote:
> > > To find out where on-entry register values live at any point in a
> > > program, GDB currently tries to parse to parse the executable code.
> > > This does not work very well, for example it gets confused if some
> > > accesses to the stack use the frame pointer (r31) and some use the
> > > stack pointer (r1).  A symptom is that backtraces can be cut short.
> > > 
> > > This patch enables -fasynchronous-unwind-tables by default for rs6000,
> > > which causes us to emit DWARF unwind tables for all functions, solving
> > > these problems.
> > > 
> > > This not do anything for sub-targets without DWARF.
> > > 
> > > It increases executable size, but only modestly, and does not change
> > > memory use, only the disk image.
> > > 
> > > Various other targets already do this (x86, s390, tile*).
> > 
> > aarch64-linux* too (since r258871).
> 
> Ah yes, I forgot.  Aarch does it in its struct default_options; is that
> preferred?  I did it in rs6000_option_init_struct because originally I
> avoided enabling it on some non-DWARF platforms, but the flag is ignored
> elsewhere anyway, and various other things set the flags for everything,
> too, so now I enable it always.

I think either is fine, just note that both x86_64 -m64 and aarch64 turn
-funwind-tables on too by default, aarch64 through the default_options,
x86 through setting f_a_u_t to 2 and then:
      if (opts->x_flag_asynchronous_unwind_tables == 2)
        opts->x_flag_unwind_tables
          = opts->x_flag_asynchronous_unwind_tables = 1;
in ix86_option_override_internal.  Note i?86 -m32 doesn't make
-funwind-tables the default on the other side, not sure if it really makes a
difference.  toplev.c process_options has:
  if (flag_non_call_exceptions)
    flag_asynchronous_unwind_tables = 1;
  if (flag_asynchronous_unwind_tables)
    flag_unwind_tables = 1;
too though.

	Jakub



More information about the Gcc-patches mailing list