From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20109 invoked by alias); 21 Nov 2012 11:18:50 -0000 Received: (qmail 19637 invoked by uid 48); 21 Nov 2012 11:18:23 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55419] [4.7/4.8 Regression] ICE in gimplify_init_ctor_preeval, at gimplify.c:3587 Date: Wed, 21 Nov 2012 11:18: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: P3 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-11/txt/msg02020.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55419 --- Comment #3 from Jakub Jelinek 2012-11-21 11:18:22 UTC --- /* We always set TREE_SIDE_EFFECTS so that expand_expr does not ignore the TARGET_EXPR. If there really turn out to be no side-effects, then the optimizer should be able to get rid of whatever code is generated anyhow. */ TREE_SIDE_EFFECTS (t) = 1; + if (literal_type_p (type)) + TREE_CONSTANT (t) = TREE_CONSTANT (value); So we end up with TARGET_EXPR with TREE_SIDE_EFFECTS, but TREE_CONSTANT set too, which is what the gimplifier is complaining about. constants shouldn't have side-effects. If this is some trick internal to the C++ FE, then at least the genericizer should drop TREE_CONSTANT from TARGET_EXPRs with TREE_SIDE_EFFECTS set that are passed down to the middle-end.