From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11860 invoked by alias); 6 Dec 2012 14:38:05 -0000 Received: (qmail 10665 invoked by uid 55); 6 Dec 2012 14:37:20 -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: Thu, 06 Dec 2012 14:38: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: RESOLVED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: 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-12/txt/msg00530.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55137 --- Comment #14 from Jakub Jelinek 2012-12-06 14:37:16 UTC --- Author: jakub Date: Thu Dec 6 14:37:09 2012 New Revision: 194250 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194250 Log: PR c++/55137 * fold-const.c (fold_binary_loc) : Don't introduce TREE_OVERFLOW through reassociation. If type doesn't have defined overflow, but one or both of the operands do, use the wrapping type for reassociation and only convert to type at the end. * g++.dg/opt/pr55137.C: New test. * gcc.c-torture/execute/pr55137.c: New test. Added: trunk/gcc/testsuite/g++.dg/opt/pr55137.C trunk/gcc/testsuite/gcc.c-torture/execute/pr55137.c Modified: trunk/gcc/ChangeLog trunk/gcc/fold-const.c trunk/gcc/testsuite/ChangeLog