re PR debug/31899 (-g and using declaration causing ICE in reference_to_unused)

2007-10-03  Doug Kwan  <dougkwan@google.com>
	Richard Guenther  <rguenther@suse.de>

	PR debug/31899
	* dwarf2out.c (reference_to_unused): Disable sanity checking,
	be conservative instead.

	* g++.dg/debug/using3.C: New testcase.

Co-Authored-By: Richard Guenther <rguenther@suse.de>

From-SVN: r128978
This commit is contained in:
Doug Kwan 2007-10-03 10:01:43 +00:00 committed by Richard Biener
parent 05dddae134
commit 7a3c4b3ef3
4 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2007-10-03 Doug Kwan <dougkwan@google.com>
Richard Guenther <rguenther@suse.de>
PR debug/31899
* dwarf2out.c (reference_to_unused): Disable sanity checking,
be conservative instead.
2007-10-03 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/26682

View File

@ -10344,9 +10344,12 @@ reference_to_unused (tree * tp, int * walk_subtrees,
return *tp;
else if (!flag_unit_at_a_time)
return NULL_TREE;
/* ??? The C++ FE emits debug information for using decls, so
putting gcc_unreachable here falls over. See PR31899. For now
be conservative. */
else if (!cgraph_global_info_ready
&& (TREE_CODE (*tp) == VAR_DECL || TREE_CODE (*tp) == FUNCTION_DECL))
gcc_unreachable ();
return *tp;
else if (DECL_P (*tp) && TREE_CODE (*tp) == VAR_DECL)
{
struct varpool_node *node = varpool_node (*tp);

View File

@ -1,3 +1,9 @@
2007-10-03 Doug Kwan <dougkwan@google.com>
Richard Guenther <rguenther@suse.de>
PR debug/31899
* g++.dg/debug/using3.C: New testcase.
2007-10-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/33253

View File

@ -0,0 +1,8 @@
// PR debug/31899
namespace NS {
int x = 0;
int &ref = x;
}
using NS::ref;