From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13623 invoked by alias); 2 Apr 2003 02:56:00 -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 13608 invoked by uid 71); 2 Apr 2003 02:56:00 -0000 Date: Wed, 02 Apr 2003 02:56:00 -0000 Message-ID: <20030402025600.13607.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Giovanni Bajo" Subject: Re: c++/8378: [Windows] G++ crashes (in certain cirumstances) when returning statics Reply-To: "Giovanni Bajo" X-SW-Source: 2003-04/txt/msg00049.txt.bz2 List-Id: The following reply was made to PR c++/8378; it has been noted by GNATS. From: "Giovanni Bajo" To: , , , , Cc: "Wolfgang Bangerth" Subject: Re: c++/8378: [Windows] G++ crashes (in certain cirumstances) when returning statics Date: Wed, 2 Apr 2003 04:50:00 +0200 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p r=8378 Confirmed with cygwin 3.2. Redux: ----------------------------------------- struct __attribute__((dllimport)) Foo { static int static_func(); }; int bar = Foo::static_func(); int Foo::static_func() { return 0; } ----------------------------------------- $ g++ -c pr8378.cpp pr8378.cpp: In static member function `static int Foo::static_func()': pr8378.cpp:12: Internal compiler error in rest_of_compilation, at toplev.c:3491 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Notice this is a regression from 2.95: $ g++-2 -c pr8378.cpp pr8378.cpp: In function `static int Foo::static_func()': pr8378.cpp:10: warning: inconsistent dll linkage for `static int Foo::static_fun c()'. dllexport assumed. If the definiiton of the variable "bar" is moved after the definition of the static function, the ICE disappears and GCC 3.2 emits a warning message just like 2.95. Synopsis can now be changed to something more appropriate, and class too (it's ice-on-legal-code). Giovanni Bajo