https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62225
--- Comment #3 from Yao Qi <qiyao at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #1) > I bet if you remove register, it will work. Or compile with variable > tracking turned on. I compiled the code again with -fvar-tracking, and looks DW_AT_location for local variable is there. <2><9a>: Abbrev Number: 7 (DW_TAG_variable) <9b> DW_AT_name : l <9d> DW_AT_decl_file : 1 <9e> DW_AT_decl_line : 15 <9f> DW_AT_type : <0x25> <a3> DW_AT_location : 0x0 (location list) <2><a7>: Abbrev Number: 7 (DW_TAG_variable) <a8> DW_AT_name : r <aa> DW_AT_decl_file : 1 <ab> DW_AT_decl_line : 15 <ac> DW_AT_type : <0x25> <b0> DW_AT_location : 0x2a (location list) Contents of the .debug_loc section: Offset Begin End Expression 00000000 080483b1 080483b4 (DW_OP_reg11 (st0)) 0000000b 080483b4 080483cf (DW_OP_fbreg: 0) 00000017 080483cf 080483d2 (DW_OP_reg11 (st0)) 00000022 <End of list> 0000002a 080483b4 080483cb (DW_OP_reg11 (st0)) 00000035 080483cb 080483ef (DW_OP_fbreg: 12) 00000041 <End of list>