From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20452 invoked by alias); 25 Feb 2008 18:50:09 -0000 Received: (qmail 20222 invoked by uid 48); 25 Feb 2008 18:49:26 -0000 Date: Mon, 25 Feb 2008 18:50:00 -0000 Message-ID: <20080225184926.20221.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/35363] Missing bit field coalescing optimization In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" 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: 2008-02/txt/msg02694.txt.bz2 ------- Comment #4 from rguenth at gcc dot gnu dot org 2008-02-25 18:49 ------- So, the same code should be generated for union { struct { int b1: 3; int b2: 3; int b3: 2; int b4: 17; }a; int b; } a; void foo() { a.a.b1 = 2; a.a.b2 = 3; a.a.b4 = 8; } void bar() { a.b = (a.b & (-1u >> (sizeof(a.b)*8 - 2) << 6)) | 2 | (3 << 3) | (8 << 17); } modulo errors I made in the bar() case ;) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35363