From patchwork Fri Jun 9 16:37:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 1793085 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=2620:52:3:1:0:246e:9693:128c; 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=eUxWXyDA; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4Qd6Gw4q5dz20Vx for ; Sat, 10 Jun 2023 02:39:04 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 748CD3856975 for ; Fri, 9 Jun 2023 16:39:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 748CD3856975 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686328742; bh=uTxQ9GbxkS8Mq9LrghCdjaXzOHG7kbvTdEI5I1kGoOc=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=eUxWXyDAzaJCr6AfF3LIAwzh0du641cva64f/2nd4clA8vLh0xWzHFi/JZ2eIOjbc kvYA9Uk2HNXBs20WPhq3/Uj+3EhWYTISKBEAcUwKIPKvWo1I27Kqyp4G9gr0MdybWo afhh1SlbQiJgjABaIqfL6pAhftTykIdz2CAuMzgA= 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 4FC54385662F for ; Fri, 9 Jun 2023 16:37:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4FC54385662F Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-155-0yFSSulLOxy23yJupr_eFw-1; Fri, 09 Jun 2023 12:37:53 -0400 X-MC-Unique: 0yFSSulLOxy23yJupr_eFw-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-75b2c4b3e02so161040085a.1 for ; Fri, 09 Jun 2023 09:37:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686328672; x=1688920672; 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=HfdFNO3hyFe8ojpyIEQ/sFr4ctL1osbMDiWom8bv854=; b=d/zM2pJibsEP5FC/hhMQSylSOzMhv2FFUXcmKendBjTrOaxMUBkkcod+9Xe32yXaTl ggd39TQqDLfCV76gitb1Rq6bhpBbX14tvQpgx6xHLkjHHS86k9zrY1CYR3SDj3aI//0Z 69pQpXir2oj6ldvwsQBmzilDS9ibKfiAof+IeLKzD/WBIsF5FfPjoHLEYziy/CMymVFz 21fJF7MCgAdKJrPGgCSYnGweuirKjE7DmIjq0h8YSlyVsQabRFnuvIe+cimd2mdtpttH abDbQlKwUV1AnavbymzKFzEA21NR6on/OoU+4BLUEWfdli4+ySBsFW+RAgd/gmmsnTEY kfAQ== X-Gm-Message-State: AC+VfDxv44OX+V20a0izQvhGP9qDPjGhirdt9Ni2eURVlJfdeOG/CTAD Vr3ckQHsGVVhRfn/wdceMIlrghbvQm+59148pkB/dAm0rbMKwsjMsUrFKIJa5ct+6TS8vtaE5xa 4a+RAexodSIsWtgLeuKkk4et0n6x7Ma22TJzqdpRqiYgXTgkP/CMddarlwLtCKCsjxxNUTkE2Q5 TZDw== X-Received: by 2002:a05:620a:618b:b0:75e:b92a:6f9a with SMTP id or11-20020a05620a618b00b0075eb92a6f9amr7630431qkn.25.1686328672747; Fri, 09 Jun 2023 09:37:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4gzKMYcDoGYwJWXhqdDQ9r92GnINqWJw/msWMhnP4FJRF6t6vGSWgGzIADnIk+LrKfEO/pFA== X-Received: by 2002:a05:620a:618b:b0:75e:b92a:6f9a with SMTP id or11-20020a05620a618b00b0075eb92a6f9amr7630406qkn.25.1686328672433; Fri, 09 Jun 2023 09:37:52 -0700 (PDT) Received: from ?IPV6:2607:fea8:51df:4200::ca58? ([2607:fea8:51df:4200::ca58]) by smtp.gmail.com with ESMTPSA id h9-20020a0cf209000000b00626a0ea44fbsm1259140qvk.23.2023.06.09.09.37.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Jun 2023 09:37:51 -0700 (PDT) Message-ID: Date: Fri, 9 Jun 2023 12:37:50 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 To: gcc-patches Cc: "hernandez, aldy" Subject: [COMMITTED] PR ipa/109886 - Also check type being cast to X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-12.4 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, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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" before casting into an irange, make sure the type being cast into is also supported by irange. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew From 6314d76cf87df92a0f7d0fdd48240283e667998a Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Fri, 9 Jun 2023 10:17:59 -0400 Subject: [PATCH 2/2] Also check type being cast to before casting into an irange, make sure the type being cast into is also supported. PR ipa/109886 * ipa-prop.cc (ipa_compute_jump_functions_for_edge): Check param type as well. --- gcc/ipa-prop.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc index ab6de9f10da..4e9a307ad4d 100644 --- a/gcc/ipa-prop.cc +++ b/gcc/ipa-prop.cc @@ -2405,6 +2405,7 @@ ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi, of this file uses value_range's, which only hold integers and pointers. */ && irange::supports_p (TREE_TYPE (arg)) + && irange::supports_p (param_type) && get_range_query (cfun)->range_of_expr (vr, arg) && !vr.undefined_p ()) { -- 2.40.1