Hi! This is something that got fixed on the trunk as part of PR48400, but in 4.6 dwarf2out_source_line is quite a bit different, emits discriminators only when using .loc directives etc. Ok for branch?
2011-10-24 Jakub Jelinek <ja...@redhat.com> PR debug/50816 * dwarf2out.c (dwarf2out_source_line): Emit discriminators only if -gdwarf-4 or not -gstrict-dwarf. --- gcc/dwarf2out.c 2011-10-20 09:51:51.000000000 +0200 +++ gcc/dwarf2out.c 2011-10-24 18:48:13.266140198 +0200 @@ -22060,7 +22060,8 @@ dwarf2out_source_line (unsigned int line fprintf (asm_out_file, " is_stmt %d", is_stmt ? 1 : 0); last_is_stmt = is_stmt; } - if (SUPPORTS_DISCRIMINATOR && discriminator != 0) + if (SUPPORTS_DISCRIMINATOR && discriminator != 0 + && (dwarf_version >= 4 || !dwarf_strict)) fprintf (asm_out_file, " discriminator %d", discriminator); fputc ('\n', asm_out_file); Jakub