This patch fixes a couple of ICEs when using -gsplit-dwarf.
authorCary Coutant <ccoutant@google.com>
Tue, 1 Jul 2014 21:35:41 +0000 (21:35 +0000)
committerCary Coutant <ccoutant@gcc.gnu.org>
Tue, 1 Jul 2014 21:35:41 +0000 (14:35 -0700)
commit25eff60debb13f86c0c11929544c43e476683057
tree3da341b9b9019236c6bf551ddc093ff2e50a588d
parent454a17a31e4d68df961e769fc2b9233204bb3adc
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.

From-SVN: r212211
gcc/ChangeLog
gcc/dwarf2out.c