From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27382 invoked by alias); 12 Dec 2011 10:02:41 -0000 Received: (qmail 27372 invoked by uid 22791); 12 Dec 2011 10:02:39 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Dec 2011 10:02:27 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/51506] Function cloning misses constant struct Date: Mon, 12 Dec 2011 10:04:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: rguenth 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: --- X-Bugzilla-Changed-Fields: Status Last reconfirmed CC Ever Confirmed Severity 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: 2011-12/txt/msg01213.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51506 Richard Guenther changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2011-12-12 CC| |jamborm at gcc dot gnu.org, | |rguenth at gcc dot gnu.org Ever Confirmed|0 |1 Severity|normal |enhancement --- Comment #1 from Richard Guenther 2011-12-12 10:02:22 UTC --- We currently do not easily see that they are constant: D.1599.a = 6; D.1599.b = 1; D.1603_1 = compute_dint (D.1599, 1); but we could in theory improve our IL by not forcing the aggregate argument to a temporary during gimplification of rv = compute_dint (<<< Unknown tree: compound_literal_expr struct dint D.1599 = {.a=6, .b=1}; >>>, 1) + rv; but simply allow !is_gimple_reg_type CONSTRUCTORs that are TREE_CONSTANT, thus have D.1603_1 = compute_dint ({.a=6, .b=1}, 1); in the IL. That would still require ipa-cp to handle aggregates though. The above would also mean that D.1599 = {.a=6, .b=1}; would be valid GIMPLE (I see no good reason to disallow this either).