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++/7103: Internal compiler error with mingw-gcc-3.1


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


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