From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22601 invoked by alias); 5 May 2014 16:11:14 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 22588 invoked by uid 89); 5 May 2014 16:11:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 May 2014 16:11:13 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s45GBBFu012090 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 5 May 2014 12:11:12 -0400 Received: from stumpy.slc.redhat.com (ovpn-113-142.phx2.redhat.com [10.3.113.142]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s45GBBw2008813; Mon, 5 May 2014 12:11:11 -0400 Message-ID: <5367B81F.9020401@redhat.com> Date: Mon, 05 May 2014 16:11:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Florian Weimer , "gcc-help@gcc.gnu.org" Subject: Re: Target dependence of conditional expression gimplification References: <53146FAA.8090802@redhat.com> <5367A8BF.5010805@redhat.com> In-Reply-To: <5367A8BF.5010805@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00018.txt.bz2 On 05/05/14 09:05, Florian Weimer wrote: > On 03/03/2014 01:03 PM, Florian Weimer wrote: >> I have code like this: >> >> if (auth_info->attrs.pin.flags & SC_PKCS15_PIN_FLAG_SO_PIN) { >> preferred = 1; >> } else { >> preferred = current; >> /* PINs are even numbered, PUKs are odd */ >> if (!(preferred & 1)) >> preferred++; >> if (preferred >= 126) >> return SC_ERROR_TOO_MANY_OBJECTS; >> } >> >> if (current > preferred || preferred > CARDOS_PIN_ID_MAX) >> return SC_ERROR_TOO_MANY_OBJECTS; >> >> On x86_64, the condition in the final if statement is gimplified as: >> >> - D.8003 = current > preferred; >> - D.8004 = preferred > 15; >> - D.8005 = D.8003 | D.8004; >> - if (D.8005 != 0) goto ; else goto ; >> >> On rs6000 (-mtune=power7 -mcpu=power7), I get this instead: >> >> + if (current > preferred) goto ; else goto ; >> + : >> + if (preferred > 15) goto ; else goto ; Yes, this is a known issue. There's places where the costing models change the gimple we initially generate and what transformations we apply later. Long term we want to push this stuff to a later point in the pipeline, but there's some disagreement over exactly how/when to do that. Jfef