From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1332 invoked by alias); 6 Nov 2012 15:04:34 -0000 Received: (qmail 1187 invoked by uid 48); 6 Nov 2012 15:04:11 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55137] [4.8 Regression] Unexpected static structure initialization Date: Tue, 06 Nov 2012 15:04:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg00485.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55137 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |jason at gcc dot gnu.org --- Comment #2 from Jakub Jelinek 2012-11-06 15:04:10 UTC --- The change is that now the struct is dynamically initialized rather than statically as it used to. So it is not wrong, just worse code quality. And the reason for that is that maybe_constant_value doesn't fold it into a constant, because there is TREE_OVERFLOW. sizeof result is size_t, unsigned type and TREE_OVERFLOW comes probably from - 1 at the end converted to -1U and then converted to int.