diff mbox

[4.6] Don't emit discriminators in .debug_line if -gstrict-dwarf and not -gdwarf-4 (PR debug/50816)

Message ID 20111024165411.GB2210@tyan-ft48-01.lab.bos.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Oct. 24, 2011, 4:54 p.m. UTC
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  <jakub@redhat.com>

	PR debug/50816
	* dwarf2out.c (dwarf2out_source_line): Emit discriminators only if
	-gdwarf-4 or not -gstrict-dwarf.


	Jakub

Comments

Jason Merrill Oct. 24, 2011, 5:40 p.m. UTC | #1
OK.

Jason
diff mbox

Patch

--- 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);