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]

Re: c++/9579: [MingW] Unable to compile DLL using mingw32-g++ 3.2.1 onWindows 2000


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


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