This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Proposed fix for bug #31899


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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]