From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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 17:23:00 -0000 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 Content-Type: text/plain X-SW-Source: 2017-10/txt/msg01555.txt.bz2 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; + } } }