From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3457 invoked by alias); 18 Apr 2005 18:41:14 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 3418 invoked by uid 48); 18 Apr 2005 18:41:09 -0000 Date: Mon, 18 Apr 2005 18:41:00 -0000 Message-ID: <20050418184109.3417.qmail@sourceware.org> From: "sabre at nondot dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050418172616.21089.matz@suse.de> References: <20050418172616.21089.matz@suse.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/21089] [4.0/4.1 Regression] C++ front-end does not "inline" the static const double X-Bugzilla-Reason: CC X-SW-Source: 2005-04/txt/msg02459.txt.bz2 List-Id: ------- Additional Comments From sabre at nondot dot org 2005-04-18 18:41 ------- Is this optimization valid? Note that it will change the behavior of this c++ program: ---- #include static const double X = 1.0; static struct S { S(); } s; static const double Y = X+2.0; S::S() { printf("%f\n", Y); } int main() {} ---- In particular, I think the C++ standard specifies that memory is zero initialized and then ctors (within a translation unit) are run in order. IANALL though. -Chris -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21089