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]
Other format: [Raw text]

Committed, partial fix for PR target/14619, incorrect dwarf2 prologue info for CRIS.


This is only a partial fix.  I've heard it helps in all cases
except when stepping within the prologue.  The right fix is 4.1
material.  Built and tested (GCC, not GDB) cross to
cris-axis-elf.

	PR target/14619
	* config/cris/cris.c (cris_target_asm_function_prologue): Create
	dwarf2 label manually and put it after, not before the prologue.

Index: cris.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/cris.c,v
retrieving revision 1.65
diff -c -p -r1.65 cris.c
*** cris.c	12 Feb 2005 01:08:33 -0000	1.65
--- cris.c	24 Feb 2005 22:11:32 -0000
*************** cris_fatal (char *arg)
*** 656,661 ****
--- 656,665 ----
    return 0;
  }
  
+ /* This variable belongs to cris_target_asm_function_prologue but must
+    be located outside it for GTY reasons.  */
+ static GTY(()) unsigned long cfa_label_num = 0;
+ 
  /* Textual function prologue.  */
  
  static void
*************** cris_target_asm_function_prologue (FILE 
*** 670,676 ****
    int framesize;
    int faked_args_size = 0;
    int cfa_write_offset = 0;
!   char *cfa_label = NULL;
    int return_address_on_stack
      = regs_ever_live[CRIS_SRP_REGNUM]
      || cfun->machine->needs_return_address_on_stack != 0;
--- 674,680 ----
    int framesize;
    int faked_args_size = 0;
    int cfa_write_offset = 0;
!   static char cfa_label[30];
    int return_address_on_stack
      = regs_ever_live[CRIS_SRP_REGNUM]
      || cfun->machine->needs_return_address_on_stack != 0;
*************** cris_target_asm_function_prologue (FILE 
*** 723,729 ****
  	  cfa_offset += cris_initial_frame_pointer_offset ();
  	}
  
!       cfa_label = dwarf2out_cfi_label ();
        dwarf2out_def_cfa (cfa_label, cfa_reg, cfa_offset);
  
        cfa_write_offset = - faked_args_size - 4;
--- 727,734 ----
  	  cfa_offset += cris_initial_frame_pointer_offset ();
  	}
  
!       ASM_GENERATE_INTERNAL_LABEL (cfa_label, "LCFIT",
! 				   cfa_label_num++);
        dwarf2out_def_cfa (cfa_label, cfa_reg, cfa_offset);
  
        cfa_write_offset = - faked_args_size - 4;
*************** cris_target_asm_function_prologue (FILE 
*** 921,926 ****
--- 926,934 ----
  	     reg_names[PIC_OFFSET_TABLE_REGNUM],
  	     reg_names[PIC_OFFSET_TABLE_REGNUM]);
  
+   if (doing_dwarf)
+     ASM_OUTPUT_LABEL (file, cfa_label);
+ 
    if (TARGET_PDEBUG)
      fprintf (file,
  	     "; parm #%d @ %d; frame " HOST_WIDE_INT_PRINT_DEC

brgds, H-P


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