From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10068 invoked by alias); 2 Apr 2013 14:09:04 -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 Received: (qmail 10005 invoked by uid 48); 2 Apr 2013 14:08:58 -0000 From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/52436] BIT_FIELD_REF > should be canonicalized for non-bitfield accesses Date: Tue, 02 Apr 2013 14:09:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: glisse at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 X-SW-Source: 2013-04/txt/msg00124.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52436 --- Comment #4 from Marc Glisse 2013-04-02 14:08:57 UTC --- (In reply to comment #3) > I'd re-organize it like Ok, I'll try something like that. > it avoids building a tree just to feed it into get_addr_base_and_unit_offset The idea was that there would be almost no cases where this was done and no simplification occurred. If a transformation is indeed done, building one tree is not that expensive, especially if it avoids code duplication. > It also avoids it if the access is not of byte-granularity which > get_addr_base_and_unit_offset does not even consider (it assumes it is fed > the argument of an ADDR_EXPR which obviously is byte-aligned). > > The tree-flow-inline.h bits look ok. In get_addr_base_and_unit_offset_1 I already check if the offset is a multiple of BITS_PER_UNIT, I should probably check that the size is a multiple as well, no? > I'm not sure what you need the forwprop / tree-ssa-propagate changes for. I need something to call fold on a bit_field_ref of a mem_ref. For PR55266, the vector lowering pass produces a mem_ref and a bit_field_ref in two distinct gimple statements, and nothing tries to combine them.