From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5216 invoked by alias); 23 Apr 2006 03:16:42 -0000 Received: (qmail 5175 invoked by uid 48); 23 Apr 2006 03:16:39 -0000 Date: Sun, 23 Apr 2006 03:16:00 -0000 Message-ID: <20060423031639.5174.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/26534] [4.1/4.2 Regression] bitfield wrong optimize In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "mmitchel at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-04/txt/msg01947.txt.bz2 List-Id: ------- Comment #6 from mmitchel at gcc dot gnu dot org 2006-04-23 03:16 ------- Generating the explicit masking operations in the front end seems to be safe, but suboptimal. The middle-end will not optimize code like: struct A {int i : 3; }; struct A a; int f() { return a.i > 3; } // Always false unless the type of the expression "a.i" has the correct precision. When compiled as C code, this function is optimized appropriately, because the C front-end uses limited-precision types to represent bitfields. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26534