From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7187 invoked by alias); 23 Apr 2012 16:08:08 -0000 Received: (qmail 7178 invoked by uid 22791); 23 Apr 2012 16:08:06 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-gy0-f175.google.com (HELO mail-gy0-f175.google.com) (209.85.160.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 Apr 2012 16:07:53 +0000 Received: by ghbz2 with SMTP id z2so6697315ghb.20 for ; Mon, 23 Apr 2012 09:07:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.245.10 with SMTP id s10mr4770717anh.65.1335197272335; Mon, 23 Apr 2012 09:07:52 -0700 (PDT) Received: by 10.101.118.15 with HTTP; Mon, 23 Apr 2012 09:07:52 -0700 (PDT) In-Reply-To: <20120423144329.GF3218@bubble.grove.modra.org> References: <20120423144329.GF3218@bubble.grove.modra.org> Date: Mon, 23 Apr 2012 16:08:00 -0000 Message-ID: Subject: Re: A case where PHI-OPT pessimizes the code From: Steven Bosscher To: Alan Modra Cc: Richard Guenther , GCC Mailing List , Richard Guenther Content-Type: text/plain; charset=ISO-8859-1 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg00792.txt.bz2 On Mon, Apr 23, 2012 at 4:43 PM, Alan Modra wrote: > On Mon, Apr 23, 2012 at 02:50:13PM +0200, Steven Bosscher wrote: >> csui = (ONEUL << a); >> b = ((csui & cst) != 0); >> if (b) >> return 1; >> else >> return 0; > > We (powerpc) would be much better if this were > > csui = (ONEUL << a); > return (csui & cst) >> a; > > Other targets would probably benefit too. Yes, this has been discussed before. See here: http://gcc.gnu.org/ml/gcc-patches/2003-01/msg01791.html http://gcc.gnu.org/ml/gcc-patches/2003-01/msg01950.html However, like Roger, I would prefer to not implement this right now. I only want to port the code from stmt.c to GIMPLE, at least initially. Later on, we could look at different code generation approaches for this kind of switch() statement. Ciao! Steven