From patchwork Mon Oct 23 17:22:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 116798 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4887990qgn; Mon, 23 Oct 2017 10:23:06 -0700 (PDT) X-Received: by 10.98.79.146 with SMTP id f18mr13863244pfj.153.1508779386516; Mon, 23 Oct 2017 10:23:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508779386; cv=none; d=google.com; s=arc-20160816; b=CK98Ev9aMsjox3FzHPPS8I2MHBfQcqoruRg7w8d6W3pApIEbZUlEWqNcc99hse9kC2 TnTVhu6m7MYNCx7ZKao0wjGH1QU26PXqZisWWrJ8jZMfjDcelGq4XEw9VvUV5qgOCQQ/ ssVoWgR4RCRr8Vn99rBiXK/zDZJjDvudZH4x2tAvfjhdKiaR4Wlh2m5Y2d4RK6aqMUGq coDRWAQAkwi/neg/werGo0Wt7d3iqqcRbYSoBwVIcNDmrwWSXUxpHCeXOFFn1vtZCq6Y s3QoSHK5mKY1ekPnRGUdUjslbFqSZRoiulS/jvFIPt/tm2LsErOmdUiOQaNHjmYu2DOT SM9g== 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=c5LnC6CNdUYGLD0c4a8Cvx7Zcn5GwyC/Sf/I8E1kmTQ=; b=ED17JR/TjUotoN0D1LLEimPMvRwmoBVgysnOA8qu2FeVNJaj2vtU2PUdGO+wZXvw1z MA9vyyltUcry40bB+xgsrNeNJ0ljChD5h/6Jr+MZ7buaHkQmm6YnanztCRZv9P/RK2J6 Db3SeIumTff76w1fay1o0hOj4vLiHGAp+sFfaJ4SQm6bxwjQGFhBHHq144z8PPRpG7f/ pMjRyK3WmVWXRgSUTVSxntwkCot8ktJlRI+GBMRmuxP18lZ/1uRyU10OqNeAERcQr2k+ JjoAGm+xgWGNP580T2WqgZ4VtML+cfTI+gJoD+0onKcdUcIFZFzuEPwbZxPLk+pWpYGo aTyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=XGH4N3cG; spf=pass (google.com: domain of gcc-patches-return-464830-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464830-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 f64si5661792pfd.85.2017.10.23.10.23.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 10:23:06 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-464830-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=XGH4N3cG; spf=pass (google.com: domain of gcc-patches-return-464830-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464830-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=bsmnwpbvkOqMLM4ac4ZtcFt+UR8zI mgJad4/UOpOIhSC/oXgL36165YrDn/ECg52xdxxEfjW4Ugi16FltnahQca5+a1zv DHf0X1GVXQ9bICXfcI7MuYv+pTdtOUUHdkAxv5LgmH1vVx5ewsEgHxlTfoiLM7LB BIxZ/XYQ2x4p8E= 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=rUMdP66jgt2dSk4NAEuqAkxQZx4=; b=XGH 4N3cG2S4OACKv26MZFnp/r8LUGQFgzwc6+JGTn/Z5hglZSFDPrXOmlamyEdQXp86 jE8SHF6uN81GqwnJq88gz18C+i7OsQBASfavoAeeHXVjfPtEEOjdApQkXRxD8ljz iPfNiuvrcrjIk/C+ld7CJMxLxm4+goIxiXZP9PRw= Received: (qmail 50557 invoked by alias); 23 Oct 2017 17:22:52 -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 50546 invoked by uid 89); 23 Oct 2017 17:22:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1964 X-HELO: mail-wr0-f181.google.com Received: from mail-wr0-f181.google.com (HELO mail-wr0-f181.google.com) (209.85.128.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 17:22:51 +0000 Received: by mail-wr0-f181.google.com with SMTP id y9so5950006wrb.2 for ; Mon, 23 Oct 2017 10:22:50 -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=c5LnC6CNdUYGLD0c4a8Cvx7Zcn5GwyC/Sf/I8E1kmTQ=; b=hipGl7kLYXo50gSEQheLgi0WwyLd/vsQgxdP7MAH6RIrshNJpkDJZIeA4yysoDryM5 gn+bTT3pbLB3Uf5mzvlXxcUezvExrbx+zPOXR5WSGB+i1c7jOVAhLq8jWlnLOA1NGkNV FBZlxBpz4ySD+IObg0RExl4RIkbzq4BvSMgzFMeXqXek+FqdU60WUU73ThizBsdwAlql 2gshiTaaIhm7m5QOEzZSciRAHl3Zn2hYXtKUf4aeprhlaHaxy43Qlr5OuQyWjMKJEs9Y S7ltn9XHB22VpQuBDEQSbo0yCXI0ouTqe4cpqMtCF0xAlsOo1J9u4qLfjYVEqppJc6jw G/QQ== X-Gm-Message-State: AMCzsaWSSZR6VUMh3afEndB3wO/7BPxTJ7aPqYg4oC2w07pn6is+F74/ v1Cam1hdmOlx8MV0LT5k5K7aX+kPVPI= X-Google-Smtp-Source: ABhQp+SbR66VEjGY9XLYTgQ4gZtknlpsIPrVpubdnd8/cLEei1SciXP5qlinKBgExFBw2lluNJMoeg== X-Received: by 10.223.151.198 with SMTP id t6mr12512447wrb.2.1508779369180; Mon, 23 Oct 2017 10:22:49 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id c142sm6539520wmh.39.2017.10.23.10.22.48 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 10:22:48 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [054/nnn] poly_int: adjust_ptr_info_misalignment References: <871sltvm7r.fsf@linaro.org> Date: Mon, 23 Oct 2017 18:22:47 +0100 In-Reply-To: <871sltvm7r.fsf@linaro.org> (Richard Sandiford's message of "Mon, 23 Oct 2017 17:54:32 +0100") Message-ID: <87efptlqxk.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch makes adjust_ptr_info_misalignment take the adjustment as a poly_uint64 rather than an unsigned int. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * tree-ssanames.h (adjust_ptr_info_misalignment): Take the increment as a poly_uint64 rather than an unsigned int. * tree-ssanames.c (adjust_ptr_info_misalignment): Likewise. Index: gcc/tree-ssanames.h =================================================================== --- gcc/tree-ssanames.h 2017-10-23 17:22:13.147805567 +0100 +++ gcc/tree-ssanames.h 2017-10-23 17:22:15.674312500 +0100 @@ -89,8 +89,7 @@ extern bool get_ptr_info_alignment (stru extern void mark_ptr_info_alignment_unknown (struct ptr_info_def *); extern void set_ptr_info_alignment (struct ptr_info_def *, unsigned int, unsigned int); -extern void adjust_ptr_info_misalignment (struct ptr_info_def *, - unsigned int); +extern void adjust_ptr_info_misalignment (struct ptr_info_def *, poly_uint64); extern struct ptr_info_def *get_ptr_info (tree); extern void set_ptr_nonnull (tree); extern bool get_ptr_nonnull (const_tree); Index: gcc/tree-ssanames.c =================================================================== --- gcc/tree-ssanames.c 2017-10-23 17:22:13.147805567 +0100 +++ gcc/tree-ssanames.c 2017-10-23 17:22:15.674312500 +0100 @@ -643,13 +643,16 @@ set_ptr_info_alignment (struct ptr_info_ misalignment by INCREMENT modulo its current alignment. */ void -adjust_ptr_info_misalignment (struct ptr_info_def *pi, - unsigned int increment) +adjust_ptr_info_misalignment (struct ptr_info_def *pi, poly_uint64 increment) { if (pi->align != 0) { - pi->misalign += increment; - pi->misalign &= (pi->align - 1); + increment += pi->misalign; + if (!known_misalignment (increment, pi->align, &pi->misalign)) + { + pi->align = known_alignment (increment); + pi->misalign = 0; + } } }