Commit 7c327f7b by Cary Coutant Committed by Cary Coutant

dwarf2out.c (dw_sra_loc_expr): Release addr_table entries when discarding a…

dwarf2out.c (dw_sra_loc_expr): Release addr_table entries when discarding a location list expression (or a...

gcc/
	* dwarf2out.c (dw_sra_loc_expr): Release addr_table entries when
        discarding a location list expression (or a piece of one).

From-SVN: r203206
parent 3700bce3
2013-10-04 Cary Coutant <ccoutant@google.com>
* dwarf2out.c (dw_sra_loc_expr): Release addr_table entries when
discarding a location list expression (or a piece of one).
2013-10-03 Jan Hubicka <jh@suse.cz> 2013-10-03 Jan Hubicka <jh@suse.cz>
* config/i386/i386.c (ix86_issue_rate): Pentium4, Nocona has issue * config/i386/i386.c (ix86_issue_rate): Pentium4, Nocona has issue
......
...@@ -13492,6 +13492,9 @@ dw_sra_loc_expr (tree decl, rtx loc) ...@@ -13492,6 +13492,9 @@ dw_sra_loc_expr (tree decl, rtx loc)
if (last != NULL && opsize != bitsize) if (last != NULL && opsize != bitsize)
{ {
padsize += bitsize; padsize += bitsize;
/* Discard the current piece of the descriptor and release any
addr_table entries it uses. */
remove_loc_list_addr_table_entries (cur_descr);
continue; continue;
} }
...@@ -13500,18 +13503,24 @@ dw_sra_loc_expr (tree decl, rtx loc) ...@@ -13500,18 +13503,24 @@ dw_sra_loc_expr (tree decl, rtx loc)
if (padsize) if (padsize)
{ {
if (padsize > decl_size) if (padsize > decl_size)
return NULL; {
remove_loc_list_addr_table_entries (cur_descr);
goto discard_descr;
}
decl_size -= padsize; decl_size -= padsize;
*descr_tail = new_loc_descr_op_bit_piece (padsize, 0); *descr_tail = new_loc_descr_op_bit_piece (padsize, 0);
if (*descr_tail == NULL) if (*descr_tail == NULL)
return NULL; {
remove_loc_list_addr_table_entries (cur_descr);
goto discard_descr;
}
descr_tail = &(*descr_tail)->dw_loc_next; descr_tail = &(*descr_tail)->dw_loc_next;
padsize = 0; padsize = 0;
} }
*descr_tail = cur_descr; *descr_tail = cur_descr;
descr_tail = tail; descr_tail = tail;
if (bitsize > decl_size) if (bitsize > decl_size)
return NULL; goto discard_descr;
decl_size -= bitsize; decl_size -= bitsize;
if (last == NULL) if (last == NULL)
{ {
...@@ -13547,9 +13556,9 @@ dw_sra_loc_expr (tree decl, rtx loc) ...@@ -13547,9 +13556,9 @@ dw_sra_loc_expr (tree decl, rtx loc)
{ {
if (BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN if (BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN
&& (memsize > BITS_PER_WORD || bitsize > BITS_PER_WORD)) && (memsize > BITS_PER_WORD || bitsize > BITS_PER_WORD))
return NULL; goto discard_descr;
if (memsize < bitsize) if (memsize < bitsize)
return NULL; goto discard_descr;
if (BITS_BIG_ENDIAN) if (BITS_BIG_ENDIAN)
offset = memsize - bitsize; offset = memsize - bitsize;
} }
...@@ -13557,7 +13566,7 @@ dw_sra_loc_expr (tree decl, rtx loc) ...@@ -13557,7 +13566,7 @@ dw_sra_loc_expr (tree decl, rtx loc)
*descr_tail = new_loc_descr_op_bit_piece (bitsize, offset); *descr_tail = new_loc_descr_op_bit_piece (bitsize, offset);
if (*descr_tail == NULL) if (*descr_tail == NULL)
return NULL; goto discard_descr;
descr_tail = &(*descr_tail)->dw_loc_next; descr_tail = &(*descr_tail)->dw_loc_next;
} }
} }
...@@ -13568,9 +13577,14 @@ dw_sra_loc_expr (tree decl, rtx loc) ...@@ -13568,9 +13577,14 @@ dw_sra_loc_expr (tree decl, rtx loc)
{ {
*descr_tail = new_loc_descr_op_bit_piece (decl_size, 0); *descr_tail = new_loc_descr_op_bit_piece (decl_size, 0);
if (*descr_tail == NULL) if (*descr_tail == NULL)
return NULL; goto discard_descr;
} }
return descr; return descr;
discard_descr:
/* Discard the descriptor and release any addr_table entries it uses. */
remove_loc_list_addr_table_entries (descr);
return NULL;
} }
/* Return the dwarf representation of the location list LOC_LIST of /* Return the dwarf representation of the location list LOC_LIST of
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment