This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: x86_64 frame unwind info


> On Wed, Oct 17, 2001 at 08:49:03PM +0200, Jan Hubicka wrote:
> > + @item -fasynchronous-unwind-tables
> > + @opindex funwind-tables
> > + Generate unwind table in dwarf2 format, if supported by target machine.  The
> > + table is exact at each instruction boundary, so it can be used for stack
> > + unwinding from asynchronous events (such as debugger or garbage collector) and
> > + is emit into eh section so it is not strip with debugging information.
> 
> I don't think you need to mention the EH section at all.  This 
> is EH data you are emitting, so of course it goes in EH sections.
> 
> 
> You should realize that flag_non_call_exceptions currently implements
> flag_asynchronous_unwind_tables.  For now you should just make
> flag_non_call_exceptions imply flag_asynchronous_unwind_tables and
> adjust dwarf2out appropriately.
Done.

Wed Oct 17 19:42:49 CEST 2001  Jan Hubicka  <jh@suse.cz>

	* toplev.c (flag_asynchronous_unwind_tables): New global variable.
	(lang_independent_options): Add asynchronous-unwind-tables
	(toplev_main): flag_asynchronous_unwind_tables implies
	flag_unwind_tables.
	* flags.h (flag_asynchronous_unwind_tables): Declare.
	* dwarf2out.c (dwarf2out_stack_adjust): Take into account
	flag_asynchronous_unwind_tables.
	(output_call_frame_info): Likewise.
	* invoke.texi (-fasynchronous-unwind-tables): Document.
	* i386.c (optimization_options): Enable
	flag_asynchronous_unwind_tables.

*** dwarf2out.c.old	Wed Oct 17 18:15:50 2001
--- dwarf2out.c	Thu Oct 18 01:00:30 2001
*************** dwarf2out_stack_adjust (insn)
*** 944,950 ****
    long offset;
    const char *label;
  
!   if (! flag_non_call_exceptions && GET_CODE (insn) == CALL_INSN)
      {
        /* Extract the size of the args from the CALL rtx itself.  */
  
--- 943,950 ----
    long offset;
    const char *label;
  
!   if (!flag_asynchronous_unwind_tables
!       && GET_CODE (insn) == CALL_INSN)
      {
        /* Extract the size of the args from the CALL rtx itself.  */
  
*************** dwarf2out_stack_adjust (insn)
*** 961,967 ****
  
    /* If only calls can throw, and we have a frame pointer,
       save up adjustments until we see the CALL_INSN.  */
!   else if (! flag_non_call_exceptions
  	   && cfa.reg != STACK_POINTER_REGNUM)
      return;
  
--- 961,967 ----
  
    /* If only calls can throw, and we have a frame pointer,
       save up adjustments until we see the CALL_INSN.  */
!   else if (!flag_asynchronous_unwind_tables
  	   && cfa.reg != STACK_POINTER_REGNUM)
      return;
  
*************** output_call_frame_info (for_eh)
*** 1722,1728 ****
       emit any EH unwind information.  */
    if (for_eh)
      {
!       int any_eh_needed = 0;
        for (i = 0; i < fde_table_in_use; ++i)
  	if (fde_table[i].uses_eh_lsda)
  	  any_eh_needed = any_lsda_needed = 1;
--- 1722,1728 ----
       emit any EH unwind information.  */
    if (for_eh)
      {
!       int any_eh_needed = flag_asynchronous_unwind_tables;
        for (i = 0; i < fde_table_in_use; ++i)
  	if (fde_table[i].uses_eh_lsda)
  	  any_eh_needed = any_lsda_needed = 1;
*** toplev.c.old	Wed Oct 17 16:55:58 2001
--- toplev.c	Thu Oct 18 00:58:54 2001
*************** int flag_exceptions;
*** 736,741 ****
--- 739,748 ----
  
  int flag_unwind_tables = 0;
  
+ /* Nonzero means generate frame unwind info table exact at each insn boundary */
+ 
+ int flag_asynchronous_unwind_tables = 0;
+ 
  /* Nonzero means don't place uninitialized global data in common storage
     by default.  */
  
*************** lang_independent_options f_options[] =
*** 1090,1095 ****
--- 1102,1109 ----
     N_("Enable exception handling") },
    {"unwind-tables", &flag_unwind_tables, 1,
     N_("Just generate unwind tables for exception handling") },
+   {"asynchronous-unwind-tables", &flag_asynchronous_unwind_tables, 1,
+    N_("Generate unwind tables exact at each instruction boundary") },
    {"non-call-exceptions", &flag_non_call_exceptions, 1,
     N_("Support synchronous non-call exceptions") },
    {"profile-arcs", &profile_arc_flag, 1,
*************** lang_independent_options f_options[] =
*** 1138,1143 ****
--- 1152,1161 ----
     N_("Align all labels") },
    {"align-functions", &align_functions, 0,
     N_("Align the start of functions") },
+   {"merge-constants", &flag_merge_constants, 1,
+    N_("Attempt to merge identical constants accross compilation units") },
+   {"merge-all-constants", &flag_merge_constants, 2,
+    N_("Attempt to merge identical constants and constant variables") },
    {"check-memory-usage", &flag_check_memory_usage, 1,
     N_("Generate code to check every memory access") },
    {"prefix-function-name", &flag_prefix_function_name, 1,
*************** toplev_main (argc, argv)
*** 4872,4877 ****
--- 4928,4938 ----
        flag_rerun_cse_after_loop = 1;
      }
  
+   if (flag_non_call_exceptions)
+     flag_asynchronous_unwind_tables = 1;
+   if (flag_asynchronous_unwind_tables)
+     flag_unwind_tables = 1;
+ 
    /* Warn about options that are not supported on this machine.  */
  #ifndef INSN_SCHEDULING
    if (flag_schedule_insns || flag_schedule_insns_after_reload)
*** flags.h.old	Wed Oct 17 18:15:40 2001
--- flags.h	Wed Oct 17 18:15:43 2001
*************** extern int flag_exceptions;
*** 451,456 ****
--- 451,460 ----
  
  extern int flag_unwind_tables;
  
+ /* Nonzero means generate frame unwind info table exact at each insn boundary */
+ 
+ extern int flag_asynchronous_unwind_tables;
+ 
  /* Nonzero means don't place uninitialized global data in common storage
     by default.  */
  
*** i386.c.old	Wed Oct 17 19:46:35 2001
--- i386.c	Wed Oct 17 19:46:36 2001
*************** optimization_options (level, size)
*** 1045,1051 ****
    if (TARGET_64BIT && optimize >= 1)
      flag_omit_frame_pointer = 1;
    if (TARGET_64BIT)
!     flag_pcc_struct_return = 0;
  }
  
  /* Table of valid machine attributes.  */
--- 1045,1054 ----
    if (TARGET_64BIT && optimize >= 1)
      flag_omit_frame_pointer = 1;
    if (TARGET_64BIT)
!     {
!       flag_pcc_struct_return = 0;
!       flag_asynchronous_unwind_tables = 1;
!     }
  }
  
  /* Table of valid machine attributes.  */
*** doc/invoke.texi.old	Wed Oct 17 19:40:42 2001
--- doc/invoke.texi	Thu Oct 18 00:59:30 2001
*************** in the following sections.
*** 602,608 ****
  @gccoptlist{
  -fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
  -ffixed-@var{reg} -fexceptions @gol
! -fnon-call-exceptions  -funwind-tables @gol
  -finhibit-size-directive  -finstrument-functions @gol
  -fcheck-memory-usage  -fprefix-function-name @gol
  -fno-common  -fno-ident  -fno-gnu-linker @gol
--- 602,608 ----
  @gccoptlist{
  -fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
  -ffixed-@var{reg} -fexceptions @gol
! -fnon-call-exceptions  -funwind-tables -fasynchronous-unwind-tables @gol
  -finhibit-size-directive  -finstrument-functions @gol
  -fcheck-memory-usage  -fprefix-function-name @gol
  -fno-common  -fno-ident  -fno-gnu-linker @gol
*************** Similar to @option{-fexceptions}, except
*** 9657,9662 ****
--- 9657,9668 ----
  static data, but will not affect the generated code in any other way.
  You will normally not enable this option; instead, a language processor
  that needs this handling would enable it on your behalf.
+ 
+ @item -fasynchronous-unwind-tables
+ @opindex funwind-tables
+ Generate unwind table in dwarf2 format, if supported by target machine.  The
+ table is exact at each instruction boundary, so it can be used for stack
+ unwinding from asynchronous events (such as debugger or garbage collector).
  
  @item -fpcc-struct-return
  @opindex fpcc-struct-return


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]