From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12805 invoked by alias); 30 Apr 2008 20:01:46 -0000 Received: (qmail 11252 invoked by uid 48); 30 Apr 2008 20:00:56 -0000 Date: Wed, 30 Apr 2008 20:01:00 -0000 Message-ID: <20080430200056.11251.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/18908] Missed folding opportunities with bools In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia 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-04/txt/msg02163.txt.bz2 ------- Comment #12 from pinskia at gcc dot gnu dot org 2008-04-30 20:00 ------- (In reply to comment #11) > Still f4 looks weird (wrong-code?!) as we fold *p = ~*p to *p = (int) *p != -1; > I'll open a PR for this. We decided this was the correct thing as we start out with ~((int)*p) != 0 which then gets folded into (int)*p != -1 and then VRP comes around and says (int)*p can only be [0,1] so it gets folded into 1. Chris said the same thing in comment #2. So f4 is now fixed. In summary, we still have some issues though: f1: not fixed (at least on PPC): lbz 3,0(3) rlwinm 3,3,0,31,31 blr That mask should not be there. f2: fixed: f2: lbz 3,0(3) blr f3: fixed f3: lbz 0,0(3) xori 0,0,1 stb 0,0(3) blr f4: fixed, only a store of 1. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18908