This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/7103: Internal compiler error with mingw-gcc-3.1
- From: Danny Smith <dannysmith at clear dot net dot nz>
- To: gcc-gnats at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, sym_phon5 at hotmail dot com,gcc-bugs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: Fri, 20 Dec 2002 07:09:40 +0000
- Subject: Re: c++/7103: Internal compiler error with mingw-gcc-3.1
- Reply-to: Danny Smith <dannysmith at users dot sourceforge dot net>
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