From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13554 invoked by alias); 6 May 2011 13:21:21 -0000 Received: (qmail 13545 invoked by uid 22791); 6 May 2011 13:21:21 -0000 X-SWARE-Spam-Status: No, hits=-2.7 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; Fri, 06 May 2011 13:21:07 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/15596] [4.3/4.4/4.5/4.6/4.7 Regression] Missed optimization with bitfields with return value 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: missed-optimization X-Bugzilla-Severity: minor X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P5 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.3.6 X-Bugzilla-Changed-Fields: Status AssignedTo 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 Date: Fri, 06 May 2011 13:21:00 -0000 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-05/txt/msg00571.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15596 Richard Guenther changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |ASSIGNED AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org |gnu.org | --- Comment #19 from Richard Guenther 2011-05-06 13:18:31 UTC --- Even with bitfield accesses lowered at the tree level we end up with : D.1736_2 = () s_1(D); BF.0_3 = MEM[(struct bitstr *)&]; D.1741_4 = BF.0_3 & -1048576; D.1742_5 = () D.1736_2; D.1743_6 = (int) D.1742_5; BF.0_7 = D.1741_4 | 1048576; BF.1_9 = BF.0_7 | D.1743_6; D.1737_13 = (signed char) l_12(D); D.1738_14 = () D.1737_13; D.1747_16 = BF.1_9 & -6291457; D.1748_17 = () D.1738_14; D.1749_18 = (int) D.1748_17; D.1750_19 = D.1749_18 << 22; BF.3_20 = D.1750_19 | D.1747_16; MEM[(struct bitstr *)&] = BF.3_20; return ; there's some optimization possibilities if we can recognize the truncating and extending conversions as bit manipulations.