From patchwork Wed Jun 6 13:13:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 925836 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-479174-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="pn4RKfke"; dkim-atps=neutral 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 4118Jn46mfz9s01 for ; Wed, 6 Jun 2018 23:14:16 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=p6h636Ic6QdgLLhV 3WmAReUyLq3YpGDXX/RosqUdM8joDvor4Votc3yfEHRIz8NcXdJsndXa66i1mGMe M+hQLvJzbT62fZ71NGC/m6SjULXqvSz9Qc7DlWh9Shi/Z15+b7PzVugQrysK13kG MHGkoBsty3f9Yjk+2TjbR8TeSOc= 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:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=1zqrOVvKJ0CYWkhKQ7slkH uRS1I=; b=pn4RKfke8AjytFanmnTdVGbFMw6UO7ovEVfmEZmFFaEo1QOcg0QIMM NPBAjvv1udYiGPRHNwWZ9uIVx0PRX6RHWU//S/ZURWD4BSq1MW1TmAvqaFjixM4K cUQN75FYr2WkjPKwotg0cP3bGQhF5i6Xe69LVkdyRxqi3UZmRGz2E= Received: (qmail 69099 invoked by alias); 6 Jun 2018 13:14:08 -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 68984 invoked by uid 89); 6 Jun 2018 13:14:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:7Bit X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 06 Jun 2018 13:14:04 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 764AA815A8 for ; Wed, 6 Jun 2018 15:14:01 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id U_kLRQTrdEKk for ; Wed, 6 Jun 2018 15:14:01 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 4F9988152A for ; Wed, 6 Jun 2018 15:14:01 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Fix PR tree-optimization/86066 Date: Wed, 06 Jun 2018 15:13:59 +0200 Message-ID: <7510373.jgzfFFhZ1x@polaris> MIME-Version: 1.0 process_store was wrongly bypassing a BIT_NOT_EXPR if there was a NOP_EXPR right after it in the SSA chain. Tested on x86-64/Linux, applied on the mainline as obvious. 2018-06-06 Eric Botcazou PR tree-optimization/86066 * gimple-ssa-store-merging.c (process_store): Do not bypass BIT_NOT_EXPR for BIT_INSERT_EXPR stores. 2018-06-06 Eric Botcazou * gcc.dg/torture/pr86066.c: New test. Index: gimple-ssa-store-merging.c =================================================================== --- gimple-ssa-store-merging.c (revision 261173) +++ gimple-ssa-store-merging.c (working copy) @@ -4333,7 +4333,9 @@ pass_store_merging::process_store (gimpl && const_bitsize <= 64) { /* Bypass a conversion to the bit-field type. */ - if (is_gimple_assign (def_stmt) && CONVERT_EXPR_CODE_P (rhs_code)) + if (!bit_not_p + && is_gimple_assign (def_stmt) + && CONVERT_EXPR_CODE_P (rhs_code)) { tree rhs1 = gimple_assign_rhs1 (def_stmt); if (TREE_CODE (rhs1) == SSA_NAME @@ -4341,6 +4343,7 @@ pass_store_merging::process_store (gimpl rhs = rhs1; } rhs_code = BIT_INSERT_EXPR; + bit_not_p = false; ops[0].val = rhs; ops[0].base_addr = NULL_TREE; ops[1].base_addr = NULL_TREE;