This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] FIX 20513
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jason Merrill <jason at redhat dot com>
- Date: Wed, 23 Mar 2005 16:15:55 +0000
- Subject: [PATCH] FIX 20513
- Organization: Codesourcery LLC
This patch fixed 20513, a dwarf ICE. We die, emitting the debug info of
a USING_DECL because we did not expect a FIELD_DECL in force_decl_die.
The related PR 15736 worked, because in that case we do not delay
emitting the debug info of the base class.
booted & tested on i686-pc-linux-gnu, ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2005-03-23 Nathan Sidwell <nathan@codesourcery.com>
PR c++/20513
* dwarf2out.c (force_decl_die): Add FIELD_DECL case. Remove
unnecessary NULL check.
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.572
diff -c -3 -p -r1.572 dwarf2out.c
*** dwarf2out.c 19 Mar 2005 03:06:51 -0000 1.572
--- dwarf2out.c 23 Mar 2005 12:13:23 -0000
*************** force_decl_die (tree decl)
*** 12477,12483 ****
case VAR_DECL:
/* Set external flag to force declaration die. Restore it after
! gen_decl_die() call. */
saved_external_flag = DECL_EXTERNAL (decl);
DECL_EXTERNAL (decl) = 1;
gen_decl_die (decl, context_die);
--- 12473,12479 ----
case VAR_DECL:
/* Set external flag to force declaration die. Restore it after
! gen_decl_die() call. */
saved_external_flag = DECL_EXTERNAL (decl);
DECL_EXTERNAL (decl) = 1;
gen_decl_die (decl, context_die);
*************** force_decl_die (tree decl)
*** 12488,12501 ****
dwarf2out_decl (decl);
break;
default:
gcc_unreachable ();
}
! /* See if we can find the die for this deci now.
! If not then abort. */
! if (!decl_die)
! decl_die = lookup_decl_die (decl);
gcc_assert (decl_die);
}
--- 12484,12501 ----
dwarf2out_decl (decl);
break;
+ case FIELD_DECL:
+ push_decl_scope (decl_context);
+ gen_decl_die (decl, context_die);
+ pop_decl_scope ();
+ break;
+
default:
gcc_unreachable ();
}
! /* We should be able to find the die now. */
! decl_die = lookup_decl_die (decl);
gcc_assert (decl_die);
}
// Copyright (C) 2005 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 24 Mar 2005 <nathan@codesourcery.com>
// PR 20513
// Origin: John Lenz <lenz@cs.wisc.edu>
// Andrew Pinski <pinskia@gcc.gnu.org>
// { dg-options "-g" }
struct Foo {
int x;
virtual ~Foo() { }
};
struct FooBar : Foo {
using Foo::x;
};