[RFA:] (take 2) dwarf2out.c (build_cfa_loc): Correct to use DW_OP_regxor DW_OP_bregx.

Hans-Peter Nilsson hp@bitrange.com
Thu Oct 5 19:08:00 GMT 2000


Duh, forget the previous build_cfa_loc patch.  I overlooked also fixing
DW_OP_breg0 + N, where N > 31 because of blindness or something.

Assuming bootstrap and check with no new regressions on
i686-pc-linux-gnulibc1 (which should not be affected, but anyway),
ok to commit?

	* dwarf2out.c (build_cfa_loc): Correct to use DW_OP_regx or
	DW_OP_bregx when cfa->reg > 31.

Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/dwarf2out.c,v
retrieving revision 1.208
diff -p -c -r1.208 dwarf2out.c
*** dwarf2out.c	2000/10/05 16:53:33	1.208
--- dwarf2out.c	2000/10/06 01:57:45
*************** build_cfa_loc (cfa)
*** 2827,2835 ****
      abort ();
  
    if (cfa->base_offset)
!     head = new_loc_descr (DW_OP_breg0 + cfa->reg, cfa->base_offset, 0);
!   else
      head = new_loc_descr (DW_OP_reg0 + cfa->reg, 0, 0);
    head->dw_loc_oprnd1.val_class = dw_val_class_const;
    tmp = new_loc_descr (DW_OP_deref, 0, 0);
    add_loc_descr (&head, tmp);
--- 2841,2856 ----
      abort ();
  
    if (cfa->base_offset)
!     {
!       if (cfa->reg <= 31)
! 	head = new_loc_descr (DW_OP_breg0 + cfa->reg, cfa->base_offset, 0);
!       else
! 	head = new_loc_descr (DW_OP_bregx, cfa->reg, cfa->base_offset);
!     }
!   else if (cfa->reg <= 31)
      head = new_loc_descr (DW_OP_reg0 + cfa->reg, 0, 0);
+   else
+     head = new_loc_descr (DW_OP_regx, cfa->reg, 0);
    head->dw_loc_oprnd1.val_class = dw_val_class_const;
    tmp = new_loc_descr (DW_OP_deref, 0, 0);
    add_loc_descr (&head, tmp);

brgds, H-P



More information about the Gcc-patches mailing list