diff options
author | Doug Kwan <dougkwan@google.com> | 2007-10-03 10:01:43 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2007-10-03 10:01:43 +0000 |
commit | 7a3c4b3ef39ecd9b3d7aab86f188871d9ea5f11a (patch) | |
tree | 043e9600c1cc47e4b07a13ed9b3cf7943cd51d38 | |
parent | 05dddae1341a2d7ddcb0313983b8545fed03df9c (diff) | |
download | gcc-7a3c4b3ef39ecd9b3d7aab86f188871d9ea5f11a.zip gcc-7a3c4b3ef39ecd9b3d7aab86f188871d9ea5f11a.tar.gz gcc-7a3c4b3ef39ecd9b3d7aab86f188871d9ea5f11a.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/debug/using3.C | 8 |
4 files changed, 25 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d08395d..02f3040 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 9ca68fb..05fd445 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0f2e06f..216454d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/g++.dg/debug/using3.C b/gcc/testsuite/g++.dg/debug/using3.C new file mode 100644 index 0000000..df3e3df --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/using3.C @@ -0,0 +1,8 @@ +// PR debug/31899 + +namespace NS { + int x = 0; + int &ref = x; +} + +using NS::ref; |