c++/7103: Internal compiler error with mingw-gcc-3.1

Danny Smith dannysmith@clear.net.nz
Thu Dec 19 23:16:00 GMT 2002


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

From: Danny Smith <dannysmith@clear.net.nz>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, sym_phon5@hotmail.com,
 gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/7103: Internal compiler error with mingw-gcc-3.1
Date: Fri, 20 Dec 2002 07:09:40 +0000

 The ICE is still present in 3.2.1 and in 3.3 branch.
 
 A definition of a function previously declared as dllimport should
 override the dllimport attribute.
 This happened  in 2.95 (with Mumit Khan's local patches to mingw
 distribution) but does not in 3.x.
 
 Here is a reduced test case:
 ================================================
 /* dllimport.C */
 /* Declare as import from dll */
 extern __attribute__((dllimport)) void foo(void);
 
 /* Use it */
 int bar(void)
 {
   foo();
 }
 
 /* Define it.
    The definition should override the dllimport attribute  */
 void foo (void){}
 
 /* end dllimport.C  */
 ===============================================
 
 G++ -c  dllimport.C
 D:\develop\bugs>G++ -c dllimport.C
 dllimport.C: In function `void foo()':
 dllimport.C:11: internal compiler error: in rest_of_compilation, at
 toplev.c:
    3571
 Please submit a full bug report,
 with preprocessed source if appropriate.
 See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
 
 
 Note: If the definition of foo is seen _before_ it is used (as below),
 the dllimport attribute is lost and
 compilation is succesful.
 
 extern __attribute__((dllimport)) void foo(void);
 
 void foo (void){}
 
 int bar(void)
 {
   foo();
 }
 
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=g
 cc&pr=7103
 



More information about the Gcc-prs mailing list