From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28459 invoked by alias); 21 Apr 2007 15:56:37 -0000 Received: (qmail 28420 invoked by uid 48); 21 Apr 2007 15:56:26 -0000 Date: Sat, 21 Apr 2007 15:56:00 -0000 Message-ID: <20070421155626.28419.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/31136] [4.2 Regression] FRE ignores bit-field truncation (C and C++ front-end don't produce bit-field truncation 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: 2007-04/txt/msg01549.txt.bz2 ------- Comment #14 from rguenth at gcc dot gnu dot org 2007-04-21 16:56 ------- Indeed. int main(void){ s.b6 = 31; s.b4 = s.b6 + s.b6; s.b6 = s.b4; return s.b6 == 15 ? 0 : 1; } Created value VH.0 for 31 + 31 ... : s.b6 = 31; D.1530_3 = 31; D.1531_4 = 31; D.1530_5 = 31; D.1531_6 = 31; D.1532_7 = D.1531_6 + D.1531_6; D.1533_8 = () D.1532_7; but luckily we don't fold () (31 + 31) wrong. (But note we also don't constant fold) Still, for folding ()() 31:6 there is a bug in fold_unary as we are calling fold_convert_const (code, type, arg0) where arg is 31:6 and type () which is obviously a no-op. We should call it on op0 instead. I'm going to test this (it's broken on the mainline as well) and commit if it succeeds. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2007-03-20 10:00:19 |2007-04-21 16:56:26 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31136