From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13825 invoked by alias); 20 Dec 2002 07:56:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 13811 invoked by uid 71); 20 Dec 2002 07:56:02 -0000 Date: Thu, 19 Dec 2002 23:56:00 -0000 Message-ID: <20021220075602.13810.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Danny Smith Subject: Re: c++/7103: Internal compiler error with mingw-gcc-3.1 Reply-To: Danny Smith X-SW-Source: 2002-12/txt/msg01076.txt.bz2 List-Id: The following reply was made to PR c++/7103; it has been noted by GNATS. From: Danny Smith To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, sym_phon5@hotmail.com, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: Re: c++/7103: Internal compiler error with mingw-gcc-3.1 Date: Fri, 20 Dec 2002 07:49:31 +0000 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