From patchwork Tue Nov 21 13:56:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 840017 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-467549-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ISFCoDPi"; 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 3yh6bR1BDTz9s71 for ; Wed, 22 Nov 2017 00:57:21 +1100 (AEDT) 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:reply-to:mime-version:content-type; q=dns; s=default; b=urCvHI4eqZLFuPzGsaKOVXQBgIRUO2xPX4QthNmJKfW thyUOsy3F7GG7njKagRWIilVoCD3lX589RpGwMlAp697Z28OyDpqryRAeH1ASfG/ N3R8IFVjREPMiSLGrKU3A10NBd2vvnUjE6n6xAvM3NtEKkEswxRGhGxk7doCPA84 = 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:reply-to:mime-version:content-type; s=default; bh=+WDBlnazbrkAILJKvyo5sGc/BKU=; b=ISFCoDPiGfsBfVReG wc8J9SYktrAeG0bJZpVE4fcA2CH7HqZx497mY55sDUrfixUvyP6jRj81Yx6lZWJk Pfpw7BMntwHHrwKmjrAjWdN+jlDhXm8XuGvwaX4/vhol/S7QyXlTFawxxmaq4e+9 005y0vg3FcvHfvXHpl36ogUXnU= Received: (qmail 51132 invoked by alias); 21 Nov 2017 13:56:36 -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 51065 invoked by uid 89); 21 Nov 2017 13:56:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.7 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KB_WAM_FROM_NAME_SINGLEWORD, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=buglet 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; Tue, 21 Nov 2017 13:56:34 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D1CE80465 for ; Tue, 21 Nov 2017 13:56:33 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-247.ams2.redhat.com [10.36.116.247]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 603DA61F21 for ; Tue, 21 Nov 2017 13:56:31 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id vALDuTsA030438 for ; Tue, 21 Nov 2017 14:56:29 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id vALDuSdc030436 for gcc-patches@gcc.gnu.org; Tue, 21 Nov 2017 14:56:28 +0100 Date: Tue, 21 Nov 2017 14:56:28 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] Fix a buglet in store merging (PR tree-optimization/83086) Message-ID: <20171121135628.GX14653@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes Hi! During the first loop iteration, n is uninitialized, so testing n.base_addr is wrong. Testing (i == first ? this_n.base_addr : n.base_addr) is overkill, perform_symbolic_merge will fail if some iterations have base_addr set and others don't. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk as obvious. 2017-11-21 Jakub Jelinek PR tree-optimization/83086 * gimple-ssa-store-merging.c (imm_store_chain_info::try_coalesce_bswap): Test this_n.base_addr rather than n.base_addr. Jakub --- gcc/gimple-ssa-store-merging.c.jj 2017-11-21 09:41:00.000000000 +0100 +++ gcc/gimple-ssa-store-merging.c 2017-11-21 12:13:23.346947756 +0100 @@ -2390,7 +2390,7 @@ imm_store_chain_info::try_coalesce_bswap ? try_size - info->bitsize - bitpos : bitpos)) return false; - if (n.base_addr && vuse_store) + if (this_n.base_addr && vuse_store) { unsigned int j; for (j = first; j <= last; ++j)