From patchwork Mon Oct 23 17:05:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 116757 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4871149qgn; Mon, 23 Oct 2017 10:05:41 -0700 (PDT) X-Received: by 10.99.127.4 with SMTP id a4mr12101151pgd.418.1508778341305; Mon, 23 Oct 2017 10:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508778341; cv=none; d=google.com; s=arc-20160816; b=aivBHoWj0m+DB4KlFVkdgYMUDJFmeWOqQvf4Uc8hjIfaMLW0e+vnlZkhEK8X4fQwQG WE8O5c98//kV8OC8LngoFqieb83TmE8dO9Y1RQn2GLcgNFs8dvjNXLSwn90evoHMbgsE C2phgnJThT4dzj5rMBoPHvD64PNWDPaYMjj9dLbymbVQDvQuxD8CtnctaxGJD6Hzf6y4 iebbgL+6qRlN31Ndo4yRUiPV3JzZqRLRPLFa+DDxD5QnoUufWMswZDZLTJY0KxcG3YL2 et47otBNHl2MIgQFIwMzKs36JpAbjR0c0i0beZfNgb3yQEbmPC72riFDsUHpm7szH5es Jw0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:mail-followup-to:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=lLF5LRJkN3yoSAimfTCGo2q3iL+Gh3gyKKFYuYMH1zE=; b=XHImOVyVLj1rIZ+yXUGpxg6UG++kV7ONEty0cAZjFYaKAN1D5MLFY3ac/HE1Rzbqha KTgpZKtJvJkEWhceejKDq8yJC+b2UYpr13kCKiAYuy9lp//9JBE7TuGYjI6qzCi5KHKJ K+I5dNTRjanQQdYeXajMOjLZqpYbKY/2u/5hAhr+fwStnMUSP526/IoxeGRAESRHqlWC 4sV1JX05kQxHtDMRt4icNwl8EDnCw62N+HAsH3L1J9wai82NIfp2+qfvjcPZRxUwWK4R Jh+4NTcTgS6CS+k4O/GzG65FwbEWwPX/dYdHEykrX+E4DbzAwzMLTcNjyrJdjX254iPi SnDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=AX3uGiwD; spf=pass (google.com: domain of gcc-patches-return-464789-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464789-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id e7si2392201plk.481.2017.10.23.10.05.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 10:05:41 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-464789-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=AX3uGiwD; spf=pass (google.com: domain of gcc-patches-return-464789-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464789-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=default; b=OQN9a4MS0u3J/AdLLA/WKccQdrrwh 0o9kQW47Mk5Rgc1ok47p7xO+mP+8Xw1VCQVhUatXlFKX64XNSJxZXdnjAtSCgEQc slYVJ/nEeGYl8w6Epu8/sQwmm5Lt6KftYc51NHRNV+UyTZC6VIjsbCE3a6eRCkef BSRcZATGjzdrmc= 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:references:date:in-reply-to:message-id:mime-version :content-type; s=default; bh=Mc+z6MecTWiI8A748ZQ14ReUx3A=; b=AX3 uGiwDLy/Ryy+sRCLSoFftyDcIob2S/+L8hOYU2qn52FJwpx/n3788lpD5xdNkF4q 1rTgz0jts1LJWdFI4TMxaI70lOPCjZkdhv/iPlp1BVM6VR0T+cXfQ/RQjuyxxlCg fWXa9AVvu8IwqtJFMENr29tNcxQc9ybDXixF5G3s= Received: (qmail 115396 invoked by alias); 23 Oct 2017 17:05:26 -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 115361 invoked by uid 89); 23 Oct 2017 17:05:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=013 X-HELO: mail-wm0-f53.google.com Received: from mail-wm0-f53.google.com (HELO mail-wm0-f53.google.com) (74.125.82.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 17:05:24 +0000 Received: by mail-wm0-f53.google.com with SMTP id q124so10886885wmb.0 for ; Mon, 23 Oct 2017 10:05:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=lLF5LRJkN3yoSAimfTCGo2q3iL+Gh3gyKKFYuYMH1zE=; b=KVQELI2x7iG4QissQBAE/p+J707gtfw9XhNb7jG/VIjp/uHtQ+0ukhn5/Q1ZrSL/kL SrtGWCxbLfsSCOFew2OEX2vdFsCAftYaxINyW54/cXCu5B2TjrU2SbtRPQZZeS+vc/xC AkOuis9HJIl7QBzG3YW94PmXvBEfGL3LpQ30bsSWife9uYiKc/P8m1n3zA+sBklNEXZn Diqkx5uNnEye83An6AHZJ6pIugkeDhRyEuzgoQE3hhO9q4CPPbuEDQBQvaaLscnzN1t1 s8DQ5B7S4lr+1jPh5ToGgOEa8TcxIGxR743PLWm8rkAwSm9ikfzd9xMYbCAnCebipdAN Mo9g== X-Gm-Message-State: AMCzsaW5wKEjkCYTeSQom+jS1YbvXMi+1WbR3EtCM/Gjxd8uNua9k2YB fdn/Qr3s9QqGExcns6m/mII53007+SY= X-Google-Smtp-Source: ABhQp+RYDjMRKj+0i+W2EUk8njjxTdGRiyUDk8F0mo3Hrh4EHlnFCcMZjD12zAG91PNiwsoJ4yWxfA== X-Received: by 10.28.47.69 with SMTP id v66mr6353768wmv.98.1508778321852; Mon, 23 Oct 2017 10:05:21 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id 56sm6123138wrx.2.2017.10.23.10.05.20 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 10:05:20 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [013/nnn] poly_int: same_addr_size_stores_p References: <871sltvm7r.fsf@linaro.org> Date: Mon, 23 Oct 2017 18:05:20 +0100 In-Reply-To: <871sltvm7r.fsf@linaro.org> (Richard Sandiford's message of "Mon, 23 Oct 2017 17:54:32 +0100") Message-ID: <87bmkxsskv.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch makes tree-ssa-alias.c:same_addr_size_stores_p handle poly_int sizes and offsets. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * tree-ssa-alias.c (same_addr_size_stores_p): Take the offsets and sizes as poly_int64s rather than HOST_WIDE_INTs. Index: gcc/tree-ssa-alias.c =================================================================== --- gcc/tree-ssa-alias.c 2017-10-23 16:52:20.150440950 +0100 +++ gcc/tree-ssa-alias.c 2017-10-23 17:01:49.579064221 +0100 @@ -2322,14 +2322,14 @@ stmt_may_clobber_ref_p (gimple *stmt, tr address. */ static bool -same_addr_size_stores_p (tree base1, HOST_WIDE_INT offset1, HOST_WIDE_INT size1, - HOST_WIDE_INT max_size1, - tree base2, HOST_WIDE_INT offset2, HOST_WIDE_INT size2, - HOST_WIDE_INT max_size2) +same_addr_size_stores_p (tree base1, poly_int64 offset1, poly_int64 size1, + poly_int64 max_size1, + tree base2, poly_int64 offset2, poly_int64 size2, + poly_int64 max_size2) { /* Offsets need to be 0. */ - if (offset1 != 0 - || offset2 != 0) + if (maybe_nonzero (offset1) + || maybe_nonzero (offset2)) return false; bool base1_obj_p = SSA_VAR_P (base1); @@ -2348,17 +2348,19 @@ same_addr_size_stores_p (tree base1, HOS tree memref = base1_memref_p ? base1 : base2; /* Sizes need to be valid. */ - if (max_size1 == -1 || max_size2 == -1 - || size1 == -1 || size2 == -1) + if (!known_size_p (max_size1) + || !known_size_p (max_size2) + || !known_size_p (size1) + || !known_size_p (size2)) return false; /* Max_size needs to match size. */ - if (max_size1 != size1 - || max_size2 != size2) + if (may_ne (max_size1, size1) + || may_ne (max_size2, size2)) return false; /* Sizes need to match. */ - if (size1 != size2) + if (may_ne (size1, size2)) return false; @@ -2386,10 +2388,9 @@ same_addr_size_stores_p (tree base1, HOS /* Check that the object size is the same as the store size. That ensures us that ptr points to the start of obj. */ - if (!tree_fits_shwi_p (DECL_SIZE (obj))) - return false; - HOST_WIDE_INT obj_size = tree_to_shwi (DECL_SIZE (obj)); - return obj_size == size1; + return (DECL_SIZE (obj) + && poly_int_tree_p (DECL_SIZE (obj)) + && must_eq (wi::to_poly_offset (DECL_SIZE (obj)), size1)); } /* If STMT kills the memory reference REF return true, otherwise