From patchwork Wed Aug 31 18:28:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Glisse X-Patchwork-Id: 664655 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sPYn0153nz9srZ for ; Thu, 1 Sep 2016 04:28:51 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=CNbi5gTO; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=KM/T0AdIrFbHtl2Xf4yc204HcG7V0f1IwuV5R+8UvhWZl0xIQgrvn RoTQJ1pSLGphmeXDTXJrWfxlAvDMGYBVNmaI73KZfYPALJThAc/Nn5PRoBJIlbHj Egf++o3zmmfq2hn3OD+M9w3PUK7jOijlkZa1P6SGShBFfPAI9oImZc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=/vwdD1LZ42+SlZa7cbKJxGjfPVk=; b=CNbi5gTOSUzBmcJwk9Fk eIVGFD0adKFa5hVL1uUL5ozKW7RMT6XdIfFY+oDl1hRmqg4tCnDRRM0gTTW44afm GA++EpcuVcm/d+IsM8SDM7zNU2OOUrIwwwvBDnvl/xHC6/xr4xbZ6cWKqTrEPSKU 6ureJgO5Hg5JpvjHBWLxiAc= Received: (qmail 114871 invoked by alias); 31 Aug 2016 18:28:43 -0000 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 Received: (qmail 114857 invoked by uid 89); 31 Aug 2016 18:28:42 -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, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=conj, H*c:HHHH X-HELO: mail3-relais-sop.national.inria.fr Received: from mail3-relais-sop.national.inria.fr (HELO mail3-relais-sop.national.inria.fr) (192.134.164.104) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 31 Aug 2016 18:28:32 +0000 Received: from ip-118.net-89-2-234.rev.numericable.fr (HELO laptop-mg.local) ([89.2.234.118]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 31 Aug 2016 20:28:29 +0200 Date: Wed, 31 Aug 2016 20:28:24 +0200 (CEST) From: Marc Glisse To: gcc-patches@gcc.gnu.org Subject: match.pd: Revert a * (1 << b) relaxation Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Hello, this patch was bootstrapped and regtested on powerpc64le-unknown-linux-gnu. Already committed, since this is simply reverting part of my patch. Index: gcc/ChangeLog =================================================================== --- gcc/ChangeLog (revision 239901) +++ gcc/ChangeLog (working copy) @@ -1,10 +1,15 @@ +2016-08-31 Marc Glisse + + PR tree-optimization/73714 + * match.pd (a * (1 << b)): Revert change from 2016-05-23. + 2016-08-31 David Malcolm * selftest.c: Move "namespace selftest {" to top of file, removing explicit "selftest::" qualifiers throughout. 2016-08-31 Marc Glisse * config/i386/avx512fintrin.h (__m512_u, __m512i_u, __m512d_u): New types. (_mm512_loadu_pd, _mm512_storeu_pd, _mm512_loadu_ps, Index: gcc/testsuite/gcc.dg/tree-ssa/pr73714.c =================================================================== --- gcc/testsuite/gcc.dg/tree-ssa/pr73714.c (revision 0) +++ gcc/testsuite/gcc.dg/tree-ssa/pr73714.c (revision 239902) @@ -0,0 +1,8 @@ +/* { dg-do compile { target lp64 } } */ +/* { dg-options "-O2 -fdump-tree-optimized-raw" } */ + +int f(int a, int b){ + return a * (int)(1L << b); +} + +/* { dg-final { scan-tree-dump "mult_expr" "optimized" } } */ Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (revision 239901) +++ gcc/testsuite/ChangeLog (working copy) @@ -1,10 +1,15 @@ +2016-08-31 Marc Glisse + + PR tree-optimization/73714 + * gcc.dg/tree-ssa/pr73714.c: New test. + 2016-08-31 Jerry DeLisle PR libgfortran/77393 * gfortran.dg/fmt_f0_2.f90: New test. 2016-08-31 Marc Glisse * gcc.target/i386/pr59539-2.c: Adapt options. * gcc.target/i386/avx512f-vmovdqu32-1.c: Relax expected asm. Index: gcc/match.pd =================================================================== --- gcc/match.pd (revision 239901) +++ gcc/match.pd (working copy) @@ -461,22 +461,21 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (for ops (conj negate) (for cabss (CABS) (simplify (cabss (ops @0)) (cabss @0)))) /* Fold (a * (1 << b)) into (a << b) */ (simplify (mult:c @0 (convert? (lshift integer_onep@1 @2))) (if (! FLOAT_TYPE_P (type) - && (element_precision (type) <= element_precision (TREE_TYPE (@1)) - || TYPE_UNSIGNED (TREE_TYPE (@1)))) + && tree_nop_conversion_p (type, TREE_TYPE (@1))) (lshift @0 @2))) /* Fold (C1/X)*C2 into (C1*C2)/X. */ (simplify (mult (rdiv@3 REAL_CST@0 @1) REAL_CST@2) (if (flag_associative_math && single_use (@3)) (with { tree tem = const_binop (MULT_EXPR, type, @0, @2); } (if (tem)