This is the mail archive of the gcc-prs@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: c++/8067: g++ 3.2 internal error: Segmentation fault


The following reply was made to PR c++/8067; it has been noted by GNATS.

From: =?iso-8859-1?Q?Pop_S=E9bastian?= <pop@gauvain.u-strasbg.fr>
To: Reichelt <reichelt@igpm.rwth-aachen.de>
Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org,
	y_fedor@ciam.ru, gcc-patches@gcc.gnu.org
Subject: Re: c++/8067: g++ 3.2 internal error: Segmentation fault
Date: Mon, 30 Sep 2002 19:28:44 +0200

 On Mon, Sep 30, 2002 at 07:35:23PM +0200, Reichelt wrote:
 > Hi,
 > 
 > the problem can be demonstated with just a single line of (legal) code:
 > 
 > ------------------snip here---------------------
 > void foo() { for ( __PRETTY_FUNCTION__ ; ; ) ; }
 > ------------------snip here---------------------
 > 
 
 Thanks for your simplified version of the bug report.
 The following trivial patch solves the ICE for PR#8067.
 
 
 Sebastian.
 
 
 Index: decl.c
 ===================================================================
 RCS file: /cvsroot/gcc/gcc/gcc/cp/decl.c,v
 retrieving revision 1.937
 diff -d -c -p -r1.937 decl.c
 *** decl.c	29 Sep 2002 11:53:48 -0000	1.937
 --- decl.c	30 Sep 2002 17:11:01 -0000
 *************** maybe_inject_for_scope_var (decl)
 *** 8006,8022 ****
   	 Otherwise, we need to preserve the temp slot for decl to last
   	 into the outer binding level.  */
   
 !       tree outer_binding
 ! 	= TREE_CHAIN (IDENTIFIER_BINDING (DECL_NAME (decl)));
 ! 
 !       if (outer_binding && BINDING_LEVEL (outer_binding) == outer
 ! 	  && (TREE_CODE (BINDING_VALUE (outer_binding))
 ! 	      == VAR_DECL)
 ! 	  && DECL_DEAD_FOR_LOCAL (BINDING_VALUE (outer_binding)))
   	{
 ! 	  BINDING_VALUE (outer_binding)
 ! 	    = DECL_SHADOWED_FOR_VAR (BINDING_VALUE (outer_binding));
 ! 	  current_binding_level->is_for_scope = 0;
   	}
         else if (DECL_IN_MEMORY_P (decl))
   	preserve_temp_slots (DECL_RTL (decl));
 --- 8006,8026 ----
   	 Otherwise, we need to preserve the temp slot for decl to last
   	 into the outer binding level.  */
   
 !       tree ib, outer_binding;
 !       ib = IDENTIFIER_BINDING (DECL_NAME (decl));
 !       if (ib)
   	{
 ! 	  outer_binding = TREE_CHAIN (ibdn);
 ! 	  
 ! 	  if (outer_binding && BINDING_LEVEL (outer_binding) == outer
 ! 	      && (TREE_CODE (BINDING_VALUE (outer_binding))
 ! 		  == VAR_DECL)
 ! 	      && DECL_DEAD_FOR_LOCAL (BINDING_VALUE (outer_binding)))
 ! 	    {
 ! 	      BINDING_VALUE (outer_binding)
 ! 		= DECL_SHADOWED_FOR_VAR (BINDING_VALUE (outer_binding));
 ! 	      current_binding_level->is_for_scope = 0;
 ! 	    }
   	}
         else if (DECL_IN_MEMORY_P (decl))
   	preserve_temp_slots (DECL_RTL (decl));
 
 
 


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