This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Proposed fix for bug #31899
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "=?big5?b?RG91ZyBLd2FuICjD9q62vHcp?=" <dougkwan at google dot com>
- Cc: "Mark Mitchell" <mark at codesourcery dot com>, "Diego Novillo" <dnovillo at google dot com>, "Daniel Berlin" <dberlin at dberlin dot org>, gcc-patches at gcc dot gnu dot org, "Jan Hubicka" <jh at suse dot cz>
- Date: Wed, 3 Oct 2007 12:02:37 +0200
- Subject: Re: [PATCH] Proposed fix for bug #31899
- References: <498552560707311623n59a20a21ve83cccf4d5583adc@mail.gmail.com> <4aca3dc20707312205g5ac078e3v1a1e72c01206ab3b@mail.gmail.com> <498552560707312248q65b63330j1b07692e090fe308@mail.gmail.com> <46B38262.6000800@google.com> <46B6933B.80000@codesourcery.com> <46B881D5.8090407@google.com> <46B88304.7030201@codesourcery.com> <84fc9c000710021009mcb3df29yc03481cf377021d@mail.gmail.com> <498552560710021024g6aabf2d2vf245ec5309396f08@mail.gmail.com>
On 10/2/07, Doug Kwan (?振德) <dougkwan@google.com> wrote:
> Sorry. I dropped that. I dont' have an SVN account and I need someone
> to commit the patch for me.
>
> -Doug
> > > OK, let's do that then.
> >
> > Hm, nothing happened. I'm going to put the fix in mainline after re-testing
> > and to the branch after 4.2.2.
> >
> > Richard.
> >
>
I have now applied the attached.
Richard.
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.
Index: dwarf2out.c
===================================================================
*** dwarf2out.c (revision 128977)
--- dwarf2out.c (working copy)
*************** reference_to_unused (tree * tp, int * wa
*** 10344,10352 ****
return *tp;
else if (!flag_unit_at_a_time)
return NULL_TREE;
else if (!cgraph_global_info_ready
&& (TREE_CODE (*tp) == VAR_DECL || TREE_CODE (*tp) == FUNCTION_DECL))
! gcc_unreachable ();
else if (DECL_P (*tp) && TREE_CODE (*tp) == VAR_DECL)
{
struct varpool_node *node = varpool_node (*tp);
--- 10344,10355 ----
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))
! return *tp;
else if (DECL_P (*tp) && TREE_CODE (*tp) == VAR_DECL)
{
struct varpool_node *node = varpool_node (*tp);
Index: testsuite/g++.dg/debug/using3.C
===================================================================
*** testsuite/g++.dg/debug/using3.C (revision 0)
--- testsuite/g++.dg/debug/using3.C (revision 0)
***************
*** 0 ****
--- 1,8 ----
+ // PR debug/31899
+
+ namespace NS {
+ int x = 0;
+ int &ref = x;
+ }
+
+ using NS::ref;