From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 690 invoked by alias); 20 Dec 2002 07:16:03 -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 668 invoked by uid 71); 20 Dec 2002 07:16:02 -0000 Date: Thu, 19 Dec 2002 23:16:00 -0000 Message-ID: <20021220071602.666.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/msg01075.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:09:40 +0000 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 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