When building the location list for a variable that has been optimized by SRA, dw_sra_loc_expr sometimes creates a DWARF expression or a piece of an expression, but then abandons it for some reason. When abandoning it, we neglected to release any addr_table entries created for DW_OP_addr_index opcodes, occasionally resulting in a link-time unresolved symbol. This patch releases the addr_table entries before abandoning a location expression.
Backported from trunk r203206. Google ref b/10833306. 2013-10-03 Cary Coutant <ccout...@google.com> gcc/ * dwarf2out.c (dw_sra_loc_expr): Release addr_table entries when discarding a location list expression (or a piece of one).