Blame SOURCES/gcc34-rh176182.patch

6693b3
2005-10-31  James E. Wilson  <wilson@specifix.com>
6693b3
6693b3
	PR debug/24444
6693b3
	* dwarf2out.c (convert_cfa_to_loc_list): Put inside DWARF2_UNWIND_INFO
6693b3
	ifdef.	Put ifdefs around call in gen_subprogram_die.
6693b3
	(compute_frame_pointer_to_cfa_displacement): Likewise.
6693b3
	(gen_subprogram_die): Restore old code for when DWARF2_UNWIND_INFO is
6693b3
	not defined.
6693b3
6693b3
--- gcc/dwarf2out.c.orig	2005-11-21 07:57:57.000000000 -0200
6693b3
+++ gcc/dwarf2out.c	2005-12-20 16:46:22.000000000 -0200
6693b3
@@ -10047,6 +10047,7 @@ tree_add_const_value_attribute (dw_die_r
6693b3
     }
6693b3
 }
6693b3
 
6693b3
+#ifdef DWARF2_UNWIND_INFO
6693b3
 /* Convert the CFI instructions for the current function into a location
6693b3
    list.  This is used for DW_AT_frame_base when we targeting a dwarf2
6693b3
    consumer that does not support the dwarf3 DW_OP_call_frame_cfa.  */
6693b3
@@ -10138,6 +10139,7 @@ compute_frame_pointer_to_cfa_displacemen
6693b3
 
6693b3
   frame_pointer_cfa_offset = -offset;
6693b3
 }
6693b3
+#endif
6693b3
 
6693b3
 /* Generate a DW_AT_name attribute given some string value to be included as
6693b3
    the value of the attribute.  */
6693b3
@@ -11385,6 +11387,7 @@ gen_subprogram_die (tree decl, dw_die_re
6693b3
       add_AT_fde_ref (subr_die, DW_AT_MIPS_fde, current_funcdef_fde);
6693b3
 #endif
6693b3
 
6693b3
+#ifdef DWARF2_UNWIND_INFO
6693b3
       /* We define the "frame base" as the function's CFA.  This is more
6693b3
 	 convenient for several reasons: (1) It's stable across the prologue
6693b3
 	 and epilogue, which makes it better than just a frame pointer,
6693b3
@@ -11411,6 +11414,17 @@ gen_subprogram_die (tree decl, dw_die_re
6693b3
 	 debugger about.  We'll need to adjust all frame_base references
6693b3
 	 by this displacement.  */
6693b3
       compute_frame_pointer_to_cfa_displacement ();
6693b3
+#else
6693b3
+      /* For targets which support DWARF2, but not DWARF2 call-frame info,
6693b3
+	 we just use the stack pointer or frame pointer.  */
6693b3
+      /* ??? Should investigate getting better info via callbacks, or else
6693b3
+	 by interpreting the IA-64 unwind info.  */
6693b3
+      {
6693b3
+	rtx fp_reg
6693b3
+	  = frame_pointer_needed ? hard_frame_pointer_rtx : stack_pointer_rtx;
6693b3
+	add_AT_loc (subr_die, DW_AT_frame_base, reg_loc_descriptor (fp_reg));
6693b3
+      }
6693b3
+#endif
6693b3
 
6693b3
 #if 0
6693b3
       /* ??? This fails for nested inline functions, because context_display