From patchwork Mon Apr 23 14:08:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 154457 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 9CE76B6F9A for ; Tue, 24 Apr 2012 00:10:01 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1335795002; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:Subject:From:To:Cc: In-Reply-To:References:Content-Type:Date:Message-ID:Mime-Version: Content-Transfer-Encoding:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=5JiwA7uy0QCCfYj7xXSyL4/E8/0=; b=AGcZnKh990IRLjr BmnhmQRwR6iXIMZoHy1wvhYuiCSjVE6gCQMa+1rxKQy6yG2TQUR0QgJvbCaIHkjf liSBHFbsVBs5UnGt6hJBRWc/fcVlAhSVZws83VQ16kSvPvsXffhmzeZNXIy9nl3h uiYHmzrJjUYIwZWdvsQBXRFMBIg4= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Received:Received:Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date:Message-ID:Mime-Version:Content-Transfer-Encoding:X-Content-Scanned:x-cbid:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=gEbe6kXK8lAde2rwlRj/TgoTH+M4GBBjZm/VJU4NJX0xqOrFQgVDMUhaUZQ2oe U3COTPiJ4lo8c487/UwMqwXn68knh1Q1boR9B5woahv1LrcQh+csWLXsZtXmPAQK XnqIzeCrLsMySn0nZDW2S6z2XS6aUM9Sq6x/Salxx9EiM=; Received: (qmail 11604 invoked by alias); 23 Apr 2012 14:09:54 -0000 Received: (qmail 11588 invoked by uid 22791); 23 Apr 2012 14:09:51 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, MAY_BE_FORGED, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e39.co.us.ibm.com (HELO e39.co.us.ibm.com) (32.97.110.160) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 Apr 2012 14:09:36 +0000 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 23 Apr 2012 08:09:35 -0600 Received: from d01dlp03.pok.ibm.com (9.56.224.17) by e39.co.us.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 23 Apr 2012 08:09:34 -0600 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id A4E55C90062 for ; Mon, 23 Apr 2012 10:09:31 -0400 (EDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q3NE9UgB046504 for ; Mon, 23 Apr 2012 10:09:30 -0400 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q3NE93PK021516 for ; Mon, 23 Apr 2012 08:09:03 -0600 Received: from [9.10.86.167] (gtp-pc.rchland.ibm.com [9.10.86.167] (may be forged)) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q3NE939F021446; Mon, 23 Apr 2012 08:09:03 -0600 Subject: Re: [PATCH] Fix PR44214 From: "William J. Schmidt" To: Richard Guenther Cc: "H.J. Lu" , gcc-patches@gcc.gnu.org, bergner@vnet.ibm.com In-Reply-To: References: <1334887118.32653.6.camel@gnopaine> <1334952441.32653.29.camel@gnopaine> Date: Mon, 23 Apr 2012 09:08:28 -0500 Message-ID: <1335190108.4814.1.camel@oc2474580526.ibm.com> Mime-Version: 1.0 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12042314-4242-0000-0000-0000016D2153 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Mon, 2012-04-23 at 11:09 +0200, Richard Guenther wrote: > On Fri, 20 Apr 2012, William J. Schmidt wrote: > > > On Fri, 2012-04-20 at 11:32 -0700, H.J. Lu wrote: > > > On Thu, Apr 19, 2012 at 6:58 PM, William J. Schmidt > > > wrote: > > > > This enhances constant folding for division by complex and vector > > > > constants. When -freciprocal-math is present, such divisions are > > > > converted into multiplies by the constant reciprocal. When an exact > > > > reciprocal is available, this is done for vector constants when > > > > optimizing. I did not implement logic for exact reciprocals of complex > > > > constants because either (a) the complexity doesn't justify the > > > > likelihood of occurrence, or (b) I'm lazy. Your choice. ;) > > > > > > > > Bootstrapped with no new regressions on powerpc64-unknown-linux-gnu. Ok > > > > for trunk? > > > > > > > > Thanks, > > > > Bill > > > > > > > > > > > > gcc: > > > > > > > > 2012-04-19 Bill Schmidt > > > > > > > > PR rtl-optimization/44214 > > > > * fold-const.c (exact_inverse): New function. > > > > (fold_binary_loc): Fold vector and complex division by constant into > > > > multiply by recripocal with flag_reciprocal_math; fold vector division > > > > by constant into multiply by reciprocal with exact inverse. > > > > > > > > gcc/testsuite: > > > > > > > > > > It caused: > > > > > > FAIL: gcc.dg/torture/builtin-explog-1.c -O0 (test for excess errors) > > > FAIL: gcc.dg/torture/builtin-power-1.c -O0 (test for excess errors) > > > > > > on x86. > > > > > > > Hm, sorry, I don't know how that escaped my testing. This was due to > > the suggestion to have the "optimize" test encompass the > > -freciprocal-math test. Looks like this changes some expected behavior, > > at least for these two tests. > > > > Two options: Revert the move of the "optimize" test, or change the tests > > to require -O1 or above. Richard, what's your preference? > > Change the test to require -O1 or above. > > Richard. > OK, following committed as obvious. Thanks, Bill gcc-testsuite: 2012-04-23 Bill Schmidt PR regression/53076 * gcc.dg/torture/builtin-explog-1.c: Skip if -O0. * gcc.dg/torture/builtin-power-1.c: Likewise. Index: gcc/testsuite/gcc.dg/torture/builtin-explog-1.c =================================================================== --- gcc/testsuite/gcc.dg/torture/builtin-explog-1.c (revision 186624) +++ gcc/testsuite/gcc.dg/torture/builtin-explog-1.c (working copy) @@ -7,6 +7,7 @@ /* { dg-do link } */ /* { dg-options "-ffast-math" } */ +/* { dg-skip-if "PR44214" { *-*-* } { "-O0" } { "" } } */ /* Define "e" with as many bits as found in builtins.c:dconste. */ #define M_E 2.7182818284590452353602874713526624977572470936999595749669676277241 Index: gcc/testsuite/gcc.dg/torture/builtin-power-1.c =================================================================== --- gcc/testsuite/gcc.dg/torture/builtin-power-1.c (revision 186624) +++ gcc/testsuite/gcc.dg/torture/builtin-power-1.c (working copy) @@ -8,6 +8,7 @@ /* { dg-do link } */ /* { dg-options "-ffast-math" } */ /* { dg-add-options c99_runtime } */ +/* { dg-skip-if "PR44214" { *-*-* } { "-O0" } { "" } } */ #include "../builtins-config.h"