This is the mail archive of the gcc-bugs@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]

[Bug c++/16924] [3.5 Regression] dllexport attribute now causes some symbols _not_ to be exported


------- Additional Comments From dannysmith at users dot sourceforge dot net  2004-08-11 22:55 -------
Thanks, Mark.

It does fix the regression, and cause no new failures.

config/sh/symbian.c  and mcore/mcore.c also need similar patch

Should, the SYMBOL_REF_DECL also be set when encode_section_info
overrides a prior dllimport declaration with a new declaration without
the attribute, like so?



*** winnt.c.mm	Thu Aug 12 07:36:01 2004
--- winnt.c	Thu Aug 12 09:13:41 2004
*************** i386_pe_encode_section_info (tree decl, 
*** 453,459 ****
  
        /* Remove DLL_IMPORT_PREFIX.  */
        tree idp = get_identifier (oldname + strlen (DLL_IMPORT_PREFIX));
!       rtx newrtl = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp));
  
        if (DECL_INITIAL (decl) || !DECL_EXTERNAL (decl))
  	warning ("%J'%D' defined locally after being "
--- 453,465 ----
  
        /* Remove DLL_IMPORT_PREFIX.  */
        tree idp = get_identifier (oldname + strlen (DLL_IMPORT_PREFIX));
!       rtx symref = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp));
!       SYMBOL_REF_DECL (symref) = decl;
!       XEXP (DECL_RTL (decl), 0) = symref;
!       DECL_NON_ADDR_CONST_P (decl) = 0;
! 
!       /* We previously set TREE_PUBLIC and DECL_EXTERNAL.
! 	 We leave these alone for now.  */
  
        if (DECL_INITIAL (decl) || !DECL_EXTERNAL (decl))
  	warning ("%J'%D' defined locally after being "
*************** i386_pe_encode_section_info (tree decl, 
*** 461,473 ****
        else
  	warning ("%J'%D' redeclared without dllimport attribute "
  		 "after being referenced with dllimport linkage", decl, decl);
- 
-       XEXP (DECL_RTL (decl), 0) = newrtl;
- 
-       DECL_NON_ADDR_CONST_P (decl) = 0;
- 
-       /* We previously set TREE_PUBLIC and DECL_EXTERNAL.
- 	 We leave these alone for now.  */
      }
  }
  
--- 467,472 ----

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16924


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