This patch fixes a couple of ICEs when using -gsplit-dwarf.
commit55adf62176d38e2baaa332cb96ce88e1a5213b2c
authorccoutant <ccoutant@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Jul 2014 21:35:41 +0000 (1 21:35 +0000)
committerccoutant <ccoutant@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Jul 2014 21:35:41 +0000 (1 21:35 +0000)
tree3da341b9b9019236c6bf551ddc093ff2e50a588d
parentc5b187cd78dda720bc824d4624caa00e93c76bfa
This patch fixes a couple of ICEs when using -gsplit-dwarf.

When compiling a small-enough compilation unit that has no address table
entries, but complex enough that -freorder-blocks-and-partition produces
location lists, dwarf2out_finish does not call index_location_lists, but
optimize_location_lists will later assume that the addr_index_table has
been indexed.
Google ref: b/15417905

When resolve_addr_in_expr replaces a CONST_STRING rtx, it directly
updates the pointer to the old expression with the new one. In the
case of a DW_OP_GNU_addr_index or DW_OP_GNU_const_index, that pointer
may be in an address table entry, which is keyed by the rtx. Instead
of directly replacing the pointer, we need to remove the old address
table entry (i.e., decrement its reference count), and add a new one.
Google ref: b/15957101

gcc/
* dwarf2out.c (remove_addr_table_entry): Remove unnecessary hash table
        lookup.
(resolve_addr_in_expr): When replacing the rtx in a location list
        entry, get a new address table entry.
(dwarf2out_finish): Call index_location_lists even if there are no
        addr_index_table entries yet.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212211 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/dwarf2out.c