From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27904 invoked by alias); 7 Jun 2002 14:46: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 27881 invoked by uid 71); 7 Jun 2002 14:46:00 -0000 Resent-Date: 7 Jun 2002 14:46:00 -0000 Resent-Message-ID: <20020607144600.27880.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, spamjunk@stny.rr.com Received:(qmail 26045 invoked by uid 61); 7 Jun 2002 14:38:43 -0000 Message-Id:<20020607143843.26044.qmail@sources.redhat.com> Date: Fri, 07 Jun 2002 07:46:00 -0000 From: spamjunk@stny.rr.com Reply-To: spamjunk@stny.rr.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: optimization/6956: when the given code is compiled with optimization > 0, it fails X-SW-Source: 2002-06/txt/msg00157.txt.bz2 List-Id: >Number: 6956 >Category: optimization >Synopsis: when the given code is compiled with optimization > 0, it fails >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Jun 07 07:45:59 PDT 2002 >Closed-Date: >Last-Modified: >Originator: spamjunk@stny.rr.com >Release: unknown-1.0 >Organization: >Environment: dos/windows >Description: #include using namespace std; template struct A { A() {} typedef T array[I]; struct B { array a; }; static B X() { const B b = {{0, 0, 5}}; return b; } }; typedef A C; int main() { printf("%d\n", C::X().a[2]); return 0; } This code fails with optimization turned on. If b is made a static constant, it doesn't fail. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: