diff mbox

Fix up rv1.C with -gdwarf-4 -fno-debug-types-section

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

Commit Message

Jakub Jelinek May 30, 2011, 6:09 p.m. UTC
Hi!

Whether DW_TAG_rvalue_reference_type or DW_TAG_reference_type
should be emitted for rvalue references shouldn't depend on
whether .debug_types section is emitted or not, it should
depend just on whether emitting DWARF4+ or not.

Ok for trunk?

2011-05-30  Jakub Jelinek  <jakub@redhat.com>

	* dwarf2out.c (modified_type_die, gen_reference_type_die): Use
	DW_TAG_rvalue_reference_type even for
	-gdwarf-4 -fno-debug-types-section.


	Jakub

Comments

Mark Wielaard May 30, 2011, 6:34 p.m. UTC | #1
On Mon, 2011-05-30 at 20:09 +0200, Jakub Jelinek wrote:
> Whether DW_TAG_rvalue_reference_type or DW_TAG_reference_type
> should be emitted for rvalue references shouldn't depend on
> whether .debug_types section is emitted or not, it should
> depend just on whether emitting DWARF4+ or not.

Urgh, I introduced that. Sorry. I was clearly not thinking.
The fix looks correct to me.

Thanks,

Mark
Jason Merrill May 30, 2011, 7:19 p.m. UTC | #2
OK.

Jason
diff mbox

Patch

--- gcc/dwarf2out.c.jj	2011-05-22 20:55:04.000000000 +0200
+++ gcc/dwarf2out.c	2011-05-30 20:03:59.081671249 +0200
@@ -13031,7 +13031,7 @@  modified_type_die (tree type, int is_con
     }
   else if (code == REFERENCE_TYPE)
     {
-      if (TYPE_REF_IS_RVALUE (type) && use_debug_types)
+      if (TYPE_REF_IS_RVALUE (type) && dwarf_version >= 4)
 	mod_type_die = new_die (DW_TAG_rvalue_reference_type, comp_unit_die (),
 				type);
       else
@@ -20686,7 +20686,7 @@  gen_reference_type_die (tree type, dw_di
 {
   dw_die_ref ref_die, scope_die = scope_die_for (type, context_die);
 
-  if (TYPE_REF_IS_RVALUE (type) && use_debug_types)
+  if (TYPE_REF_IS_RVALUE (type) && dwarf_version >= 4)
     ref_die = new_die (DW_TAG_rvalue_reference_type, scope_die, type);
   else
     ref_die = new_die (DW_TAG_reference_type, scope_die, type);