http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55608
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-03-21 20:03:19 UTC --- Author: jakub Date: Thu Mar 21 17:35:39 2013 New Revision: 196886 URL: http://gcc.gnu.org/viewcvs?rev=196886&root=gcc&view=rev Log: PR debug/55608 * dwarf2out.c (tree_add_const_value_attribute): Call ggc_free (array) on failure. (resolve_one_addr): Fail if referenced STRING_CST hasn't been written. (string_cst_pool_decl): New function. (optimize_one_addr_into_implicit_ptr): New function. (resolve_addr_in_expr): Optimize DWARF location expression DW_OP_addr DW_OP_stack_value where DW_OP_addr refers to some variable which doesn't live in memory, but has DW_AT_location or DW_AT_const_value, or refers to a string literal, into DW_OP_GNU_implicit_pointer. (optimize_location_into_implicit_ptr): New function. (resolve_addr): If removing DW_AT_location of a variable because it was DW_OP_addr of address of the variable, but the variable doesn't live in memory, try to emit const value attribute for the initializer. Modified: trunk/gcc/ChangeLog trunk/gcc/dwarf2out.c