This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9579: [MingW] Unable to compile DLL using mingw32-g++ 3.2.1 onWindows 2000
- From: Danny Smith <dannysmith at clear dot net dot nz>
- To: gcc-gnats at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, nobody at gcc dot gnu dot org,gcc-prs at gcc dot gnu dot org, george dot wu at necsam dot com
- Date: Thu, 06 Feb 2003 03:55:01 +0000
- Subject: Re: c++/9579: [MingW] Unable to compile DLL using mingw32-g++ 3.2.1 onWindows 2000
- Reply-to: Danny Smith <dannysmith at users dot sourceforge dot net>
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=g
cc&pr=9579
This is still a bug on trunk.
Here is minimal testcase showing bug:
I believe there are several other PR's closely related if not identical
to this.
Note: The ICE is seen only with C++, However, although it compiles as
C, the output
is incorrect, in that the dllimport attribute is not overrriden.
/* dllimport.C */
/* Declare as dllimport */
__attribute__((dllimport)) void foo(void);
/* if the definition comes before use, everything is fine */
#ifdef DEFINEFIRST
/* Define it: This should override the dllimport attribute */
void foo(void) {}
#endif
void bar(void)
{
foo(); /* Use it: This will call _imp__foo, not foo, unless dllimport
is overriden */
}
#ifndef DEFINEFIRST
/* Define it: This should override the dllimport attribute */
void foo(void) {}
#endif
gcc -S dllimport.C
dllimport.C: In function `void foo()':
dllimport.C:19: internal compiler error: in rest_of_compilation, at
toplev.c:
3601
gcc -S -DDEFINEFIRST dllimport.C compiles fine.
Danny