On Wed, Sep 03, 2014 at 03:01:17PM +0930, Alan Modra wrote: > In fact if you look at the corresponding location expression for > -fno-section-anchors code you get something quite screwy too. > > 0000018f 00000108 00000114 (DW_OP_breg10 (r10): 0; DW_OP_addr: 144; > DW_OP_plus; DW_OP_stack_value > > which is (r10) + &modulus.
Fixed with this obvious patch. Emitting part of a .debug_loc expression is worse than no expression. Bootstrapped and regression tested x86_64-linux and committed revision 214899. PR debug/60655 * dwarf2out.c (mem_loc_descriptor <PLUS>): Return NULL if addend can't be output. Index: gcc/dwarf2out.c =================================================================== --- gcc/dwarf2out.c (revision 214898) +++ gcc/dwarf2out.c (working copy) @@ -12699,7 +12699,7 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mod op1 = mem_loc_descriptor (XEXP (rtl, 1), mode, mem_mode, VAR_INIT_STATUS_INITIALIZED); if (op1 == 0) - break; + return NULL; add_loc_descr (&mem_loc_result, op1); add_loc_descr (&mem_loc_result, new_loc_descr (DW_OP_plus, 0, 0)); -- Alan Modra Australia Development Lab, IBM