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


http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=g
cc&pr=7103

Correction to last message:

Gcc-2.95 did compile this testcase code without error.
===========================================
/* 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){}
===========================================
However, the results of compilation with 2.95 would cause a link
failure.  Here is the assembler output with 2.95 (using C ).  Linking
this file would cause undefined reference to __imp__foo (ie, foo
declared as dllimport).  So the bug is really that the compiler now ICES
rather than outputting a warning or error (which it didn't do in 2.95
either).:

  .file "dllimport.c"
gcc2_compiled.:
___gnu_compiled_c:
.text
 .align 4
.globl _bar
 .def _bar; .scl 2; .type 32; .endef
_bar:
 pushl %ebp
 movl %esp,%ebp
 subl $20,%esp
 pushl %ebx
 movl __imp__foo,%ebx  <<< undefined symbol with dllimport decoration
 call *%ebx
L2:
 movl -24(%ebp),%ebx
 movl %ebp,%esp
 popl %ebp
 ret
 .align 4
.globl _foo
 .def _foo; .scl 2; .type 32; .endef
_foo:
 pushl %ebp
 movl %esp,%ebp
L3:
 movl %ebp,%esp
 popl %ebp
 ret

Danny


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