🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1100

Fix for G++ 2.3.1 TREE_PUBLIC bug

#1100
From: Chip Salzenberg
Date: Fri, 06 Nov 1992 09:02
41 lines
1850 bytes
Under some circumstances, G++ 2.3.1 can set DECL_EXTERNAL on a
function without setting TREE_PUBLIC.  Below is a fix.

========================================================================
Thu Nov  5 16:52:37 1992  Chip Salzenberg  (chip@tct.com)

	* cp-decl.c (finish_decl): Set TREE_STATIC, TREE_PUBLIC and
	DECL_EXTERNAL correctly for use with #pragma interface.

Index: cp-decl.c
*************** finish_decl (decl, init, asmspec_tree, n
*** 5818,5834 ****
  	      /* If this is a static const, change its apparent linkage
  		 if it belongs to a #pragma interface.  */
! 	      if (TREE_STATIC (decl) && interface_unknown == 0)
  		{
! 		  if (interface_only)
! 		    {
! 		      TREE_STATIC (decl) = 0;
! 		      DECL_EXTERNAL (decl) = 1;
! 		    }
! 		  else
! 		    {
! 		      TREE_PUBLIC (decl) = 1;
! 		      /* Marking it used will cause it to be written.  */
! 		      TREE_USED (decl) = 1;
! 		    }
  		}
  	      make_decl_rtl (decl, asmspec, toplev);
--- 5818,5825 ----
  	      /* If this is a static const, change its apparent linkage
  		 if it belongs to a #pragma interface.  */
! 	      if (TREE_STATIC (decl) && !interface_unknown)
  		{
! 		  TREE_PUBLIC (decl) = 1;
! 		  DECL_EXTERNAL (decl) = interface_only;
  		}
  	      make_decl_rtl (decl, asmspec, toplev);

-- 
Chip Salzenberg at Teltronics/TCT  <chip@tct.com>, <73717.366@compuserve.com>
Technical Details
Message-ID: <m0mnYwW-0000XGC@animal.tct.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tct.COM!chip

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tct.COM!chip
From: chip@tct.COM (Chip Salzenberg)
Subject: Fix for G++ 2.3.1 TREE_PUBLIC bug
Message-ID: <m0mnYwW-0000XGC@animal.tct.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 6 Nov 1992 09:02:04 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 42