From patchwork Tue Oct 3 21:17:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 1842905 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Kln6eV6X; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S0Vyp6xS9z1yng for ; Wed, 4 Oct 2023 08:17:37 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9CC4E385703A for ; Tue, 3 Oct 2023 21:17:34 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 905A23858296 for ; Tue, 3 Oct 2023 21:17:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 905A23858296 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696367843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=L9+j3MEKE95Vnu4+OyoBrLdIq5RnDwHHQMEly+UINPM=; b=Kln6eV6XNkqVGVK5WDUZ/kTJgnFwIzTcPXawaouHhFNoWA0MSjQeiTLwsWUrpdlunKzPgz Ujfi2ZrusyH79ANLhweTywvErdHArgzs8HB03oZ1ZN7UMXydwhiYMxHyEZJWRo9dGeDSYt pzjqyyOsCIF87Ue7lhF/nt316hsfCxM= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-584-HElwN_fTOPyfKqKhWXAAJQ-1; Tue, 03 Oct 2023 17:17:21 -0400 X-MC-Unique: HElwN_fTOPyfKqKhWXAAJQ-1 Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-41975c9e66fso4091771cf.0 for ; Tue, 03 Oct 2023 14:17:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696367841; x=1696972641; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=WEzCHMyhytJsy9qjDNaDw85TBCiDavZXQL8K7Zt4PTs=; b=eqayeTh6SB7SGcUwTXjdwrP36jKSlCBChwYmNue5/tt3bt02Ml5/jR/kBCfW3qga4T d7lORTwN0VRX4ROxB7esug1QBDvampyPwheVWOLCir+E1bdCwSUGRdiGjF3L4zlFR6aH I1pY5wNZ8K02wW+bUZqfrLYQwLrUwC9LOF2wvsiB0arWSvg1uI8V/ZAi2Zi2UPUi8us3 i5hz7fc3luJASKmmaAO6Rg2dSFAfml0peXdSs/BpnqdSXW2qmHhqxA+KUfT6g44AACOn R/gUMKQJUOUj+RbCg2wtV2VNIVIykQNPMLlhnKesNyvFBorn7g2wmCcpQue30SoyjNrn Isag== X-Gm-Message-State: AOJu0YxYRyE2GwIuYNubC501D8pVLqBX/69knD0TsNRx6V3nrCf5z5V2 l3zmJyAMIP9LVK9b5ZASN/PAtA5/V81lFamkZnBzDEj416xVJM/19FvhO0zEk/0xkeAWBcVuHpO xs5HbkAmqFBoQ55xvIA== X-Received: by 2002:a05:622a:113:b0:417:fa23:4f40 with SMTP id u19-20020a05622a011300b00417fa234f40mr4521991qtw.33.1696367841201; Tue, 03 Oct 2023 14:17:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGb9PKlooXJcDlzK0QgPOIi8mXzzYF4Pj3CeZdEwCcTx8aYU6iT0K4139h1xDMVlLFNa5Tfzw== X-Received: by 2002:a05:622a:113:b0:417:fa23:4f40 with SMTP id u19-20020a05622a011300b00417fa234f40mr4521971qtw.33.1696367840935; Tue, 03 Oct 2023 14:17:20 -0700 (PDT) Received: from [192.168.0.174] ([104.219.124.252]) by smtp.gmail.com with ESMTPSA id j25-20020a05620a001900b0076f16e98851sm772495qki.102.2023.10.03.14.17.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Oct 2023 14:17:20 -0700 (PDT) Message-ID: <0fe4c141-dcf0-8383-6a11-e1ca33e23220@redhat.com> Date: Tue, 3 Oct 2023 17:17:21 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: [COMMITTED] Don't use range_info_get_range for pointers. To: David Edelsohn Cc: GCC Patches References: From: Andrew MacLeod In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Properly check for pointers instead of just using range_info_get_range. bootstrapped on 86_64-pc-linux-gnu (and presumably AIX too :-) with no regressions. On 10/3/23 12:53, David Edelsohn wrote: > AIX bootstrap is happier with the patch. > > Thanks, David > > commit d8808c37d29110872fa51b98e71aef9e160b4692 Author: Andrew MacLeod Date: Tue Oct 3 12:32:10 2023 -0400 Don't use range_info_get_range for pointers. Pointers only track null and nonnull, so we need to handle them specially. * tree-ssanames.cc (set_range_info): Use get_ptr_info for pointers rather than range_info_get_range. diff --git a/gcc/tree-ssanames.cc b/gcc/tree-ssanames.cc index 1eae411ac1c..0a32444fbdf 100644 --- a/gcc/tree-ssanames.cc +++ b/gcc/tree-ssanames.cc @@ -420,15 +420,11 @@ set_range_info (tree name, const vrange &r) // Pick up the current range, or VARYING if none. tree type = TREE_TYPE (name); - Value_Range tmp (type); - if (range_info_p (name)) - range_info_get_range (name, tmp); - else - tmp.set_varying (type); - if (POINTER_TYPE_P (type)) { - if (r.nonzero_p () && !tmp.nonzero_p ()) + struct ptr_info_def *pi = get_ptr_info (name); + // If R is nonnull and pi is not, set nonnull. + if (r.nonzero_p () && (!pi || pi->pt.null)) { set_ptr_nonnull (name); return true; @@ -436,6 +432,11 @@ set_range_info (tree name, const vrange &r) return false; } + Value_Range tmp (type); + if (range_info_p (name)) + range_info_get_range (name, tmp); + else + tmp.set_varying (type); // If the result doesn't change, or is undefined, return false. if (!tmp.intersect (r) || tmp.undefined_p ()) return false;