From patchwork Wed Oct 19 16:04:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 1692074 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=Wz1zwUKL; dkim-atps=neutral Received: from sourceware.org (server2.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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MswXd4hW9z23jk for ; Thu, 20 Oct 2022 03:04:32 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E67AF385841D for ; Wed, 19 Oct 2022 16:04:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E67AF385841D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666195469; bh=UsNGQEqjZUDwX/3ib9/pd1KQYEBt4jaFRcGcICvidio=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Wz1zwUKLZ7Jlj3XblML7dfmXbMheMuw9xpC1h5MGjnbb68yXyGQw5w0NyKrLGEOtP 2MHtQWxKK3eP/d2BK+K2PUdJTzJusNE1wZSzA0KDeIV0CNhsvQu7xcpqKGm5mCPnyN m62iey39PjQQ3SfvPxvqdVQmqNeCEhi+kNGWDUNk= 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.129.124]) by sourceware.org (Postfix) with ESMTPS id E15B23858D3C for ; Wed, 19 Oct 2022 16:04:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E15B23858D3C Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-581-xnticeXaOWWfZZNAgmK17Q-1; Wed, 19 Oct 2022 12:04:07 -0400 X-MC-Unique: xnticeXaOWWfZZNAgmK17Q-1 Received: by mail-il1-f199.google.com with SMTP id s2-20020a056e02216200b002f9de38e484so16656256ilv.8 for ; Wed, 19 Oct 2022 09:04:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=subject:from:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VNjM9c5FFFsEMC4dLfYvf46MKRKGHRhFPrbBrTJUumM=; b=Yk6DMgm3Vz1+0iWa+ArafiM7NJQAGb2Y5bMiRgt2OVjcsCZhU2uyygkzhw499QZqPh kgl5ruycHgCvxFeR/MjDEdZUYZRisFJe2WVjWZDf8SpBOZBQFdoq5dg5NW2NBto12Lxk EmQbtI/E/AF1T/WCGCoUrR+4/s2+I8mLcxCGqG/yVnSdS6FWmhwqACXD4EtohEPfI4Io akw7rLDELWu2sq4j6ZMXzvXbDBHy1NLdbD2oePnO2PROpC5UMw5ShMhm+Mj1AUjJ6gZH tAb2pLf+SS34m9GgRkjUcry23L8R6OrdMcEWLNiu0ehNxcZbZMTmkEF0KMV5v/WD7us+ yX+Q== X-Gm-Message-State: ACrzQf1TC+PJ1og56rsBttCC4pn5FqJegS9oYtK+OjRH4VRmSLxv++e+ sdn8JqMDTddvCZD3YHtlr7iMmO6lo1hoNjZN0MoylaRkxn1W2KzuyyEai8RDGrMusxKVwq5/t88 coFNjIXRla4excRg21xEdR/tXi6WVZfDaDy7jsfIoTeUzA4kA7zfTDsAQJkDEc7Yzl1AvgA== X-Received: by 2002:a6b:6709:0:b0:6bc:269e:e81a with SMTP id b9-20020a6b6709000000b006bc269ee81amr6160282ioc.174.1666195445647; Wed, 19 Oct 2022 09:04:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6gvs/1vLu9cobbkMNF1gl3248sgbdiv5owSSsRuZox/Io3s/74rk4yI8cWTjfNLgEXgvKbvw== X-Received: by 2002:a6b:6709:0:b0:6bc:269e:e81a with SMTP id b9-20020a6b6709000000b006bc269ee81amr6160272ioc.174.1666195445346; Wed, 19 Oct 2022 09:04:05 -0700 (PDT) Received: from ?IPV6:2607:fea8:a263:f600::3c4d? ([2607:fea8:a263:f600::3c4d]) by smtp.gmail.com with ESMTPSA id z23-20020a056638215700b0035aa01f02e2sm2197657jaj.111.2022.10.19.09.04.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 09:04:04 -0700 (PDT) Message-ID: <0dfdbb0d-3ea3-70e6-7a16-51bcc0d9a86c@redhat.com> Date: Wed, 19 Oct 2022 12:04:03 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 To: gcc-patches Subject: [COMMITTED] Use Value_Range when applying inferred ranges. X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-12.6 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_H2, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew MacLeod via Gcc-patches From: Andrew MacLeod Reply-To: Andrew MacLeod Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Apply a non-integral inferred range could trap because I was using an int_range_max as the temp.  doh.   Fortunately there are no inferred floating points at this point in time. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew commit 69a233610f6b27cd4283561569d8ce0f35044dc4 Author: Andrew MacLeod Date: Wed Oct 19 09:21:22 2022 -0400 Use Value_Range when applying inferred ranges. Applying an inferred range is using int_range_ma as the temporary rather than the general purpose Value_Range. This causes it to trap if we have a non-integral inferred range. * gimple-range-cache.cc (ranger_cache::range_from_dom): Use Value_Range not int_range_max. diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc index 0b9aa3639c5..f279371948a 100644 --- a/gcc/gimple-range-cache.cc +++ b/gcc/gimple-range-cache.cc @@ -1546,7 +1546,6 @@ ranger_cache::range_from_dom (vrange &r, tree name, basic_block start_bb, void ranger_cache::apply_inferred_ranges (gimple *s) { - int_range_max r; bool update = true; basic_block bb = gimple_bb (s); @@ -1572,6 +1571,7 @@ ranger_cache::apply_inferred_ranges (gimple *s) m_exit.add_range (name, bb, infer.range (x)); if (update) { + Value_Range r (TREE_TYPE (name)); if (!m_on_entry.get_bb_range (r, name, bb)) exit_range (r, name, bb, RFD_READ_ONLY); if (r.intersect (infer.range (x)))