Patchwork [google/4.6] Fix DW_OP_GNU_addr_index problem with -gfission. (issue5866047)

login
register
mail settings
Submitter Cary Coutant
Date March 20, 2012, 11:33 p.m.
Message ID <20120320233313.C7E35E0779@ccoutant.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/147879/
State New
Headers show

Comments

Cary Coutant - March 20, 2012, 11:33 p.m.
For google/gcc-4_6 branch.

Fix bug where we were outputting a garbage value for the index operand
of DW_OP_GNU_addr_index.

Tested: incremental remake in GCC build directory and hand tested.


2012-03-20   Cary Coutant  <ccoutant@google.com>

	* dwarf2out.c (size_of_loc_descr): Use val_index instead of
	v.val_unsigned.
	(output_loc_operands): Likewise.



--
This patch is available for review at http://codereview.appspot.com/5866047

Patch

Index: dwarf2out.c
===================================================================
--- dwarf2out.c	(revision 185585)
+++ dwarf2out.c	(working copy)
@@ -4902,7 +4902,7 @@  size_of_loc_descr (dw_loc_descr_ref loc)
       size += DWARF2_ADDR_SIZE;
       break;
     case DW_OP_GNU_addr_index:
-      size += size_of_uleb128 (loc->dw_loc_oprnd1.v.val_unsigned);
+      size += size_of_uleb128 (loc->dw_loc_oprnd1.val_index);
       break;
     case DW_OP_const1u:
     case DW_OP_const1s:
@@ -5283,7 +5283,7 @@  output_loc_operands (dw_loc_descr_ref lo
       break;
 
     case DW_OP_GNU_addr_index:
-      dw2_asm_output_data_uleb128 (loc->dw_loc_oprnd1.v.val_unsigned,
+      dw2_asm_output_data_uleb128 (loc->dw_loc_oprnd1.val_index,
                                    "(address index)");
       break;