From patchwork Thu Jun 8 18:57:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 105084 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp478837vqr; Thu, 8 Jun 2023 11:58:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ64A7u95KurPBADFlE3ximxn00z8u6FfHUy1rViMg/goKjrHHE+6XzJP0UB8z7SsJ9JQYGZ X-Received: by 2002:a05:6402:1202:b0:516:a1ee:bf5 with SMTP id c2-20020a056402120200b00516a1ee0bf5mr4003275edw.7.1686250723466; Thu, 08 Jun 2023 11:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686250723; cv=none; d=google.com; s=arc-20160816; b=EAmErMiv+A8gJLC0s7ZDF/dyYk3vRvC3xLf1HNb+H1wuY01fdzCfxChQGGLpUMJ8fu PJpK2FOBPLo5+sVWuL/3Y6qmsS16l+k8aqRU1YcFZwAgEYAyAfQDYjX7LCyf4qbwfIe4 +yddaVx/AYE4lPfVA6ZLq/BzIycVC4MfdXg35reqFnS+eBtHYKaHBlHXZcADI/ji5Ln5 SeqYE9uam1nkuaP35Z6dDGcQ1prZ3lAi/DqWHH7H6XpwR4fh+KRaSnHwLaA9FrLP5oeq 9SxhXOAkzqWzroyLx1q8Jn1h7bvQYfd+79AvCXqmr8bSpMY8sRaCpT/d7KnnuYTywg+g ujSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:content-language :subject:cc:to:user-agent:mime-version:date:message-id:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=/1WXQmSbmVi0Nbsuc+wSrPlTdXQbs1erfXUTrZ+ozcc=; b=kqNk/rQXBB+s+GPDTed0RaNxN7UsQgNg6JCy3vMDesBRb0bBHHt0FZYvquIiqWTPuS JGR7OBuFFtbP/RHIVJqb+rMNpat2cufgvkhzABkNTIVJv4EjK40X/x4kCBp0uJAx6Cht ooKYGnqlWl01w0B0krriyrBM9I6u+2ahajeaCGXzeDkOKzeBs0KXkxiV2bm7g8j3DOvI HBdPweVAIl/EA+j90Vd/0qGOEv95GCYRdSadniBOu9Ry6kGaEiRTioSGK1RMuJmsyEUx NvRlSLTmdfP6i9MtF/9X4tUzSI8Kf5pXoJGieKP0wCMeoCUJB7Hh1/eHMan6e6Bu+YUD nmpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Bz8OCUUW; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id r19-20020aa7d593000000b00516a194673fsi1152120edq.574.2023.06.08.11.58.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 11:58:43 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Bz8OCUUW; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A1E64385701C for ; Thu, 8 Jun 2023 18:58:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1E64385701C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686250698; bh=/1WXQmSbmVi0Nbsuc+wSrPlTdXQbs1erfXUTrZ+ozcc=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Bz8OCUUWU90o7nzjd4apqr5ReQVFq1xE8fEkce4nmXuKYahIGK4Yt5svWvq43uBE/ wJNoeNGRTI1AYoA8qD3DgGP82xdjmJFm7TEYWMFc2C/iIZMS2v6IrthaH/FNR8JsBo TUtchYZGpjnzTnJW5u/jjyE+L5UJBzUF07d/EZoI= 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 6DC553858C2F for ; Thu, 8 Jun 2023 18:57:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6DC553858C2F Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-266-f8tZeONbMRms0PDzKrwPAw-1; Thu, 08 Jun 2023 14:57:29 -0400 X-MC-Unique: f8tZeONbMRms0PDzKrwPAw-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-75d53bab5a9so122640385a.2 for ; Thu, 08 Jun 2023 11:57:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686250648; x=1688842648; 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=+ytaaAmFtUr9NVSD7a97rSULIv9DomOYNxx5jtVk98w=; b=BAutUs1O0ftTFW+4+pzFwS0pMWKLGPYfyhmpQLfADJr956WQrjNO48oSyKZzWKUuUL q+Y3+YZQgSo5l2BVSNTAQbLJCKTlROhzsrVi5DBnaH5vJpkKXKFFPspvT5D8qVeiB5ja 0Xrq3YZnVUojH15xspaFqws2RdTQ0blLNe0KitHzRwJtZflQc86JQJEEiC0jKDmFpKu9 waMUGCnYewUCavyPYtq9anjn4qV/eWRVJfHlI4tdG/tQ2j4Ia7EWuQ8bdAp8zVHg/nXg fNK8JiJT9hpt5S71X4lJsW04Pc3WJ3YyD0kCUAUJCURwZvxJ87NfEaMRzU6FukyGn2Oz sM7A== X-Gm-Message-State: AC+VfDwuwk5hDa6jmzQFxNTTJJrx0XZMZon0gC0+dWv3HVgAvhouuQtz eRiWdfj+RT9kT4QGR6DEG4BrIGVLg/YouJyTAKOR7UACbDEQjh7S5oAH6iD6Vqm9LpqP9dJe3X4 wOdJaAG4W+rr9RRKEpdV5PjYI6ZLKFw6hSHpSQmIvaAfilQAjF6tVLpORXh/YtMsDILsc/4UGq4 7teA== X-Received: by 2002:ac8:5741:0:b0:3f6:c609:e9da with SMTP id 1-20020ac85741000000b003f6c609e9damr9107987qtx.44.1686250648690; Thu, 08 Jun 2023 11:57:28 -0700 (PDT) X-Received: by 2002:ac8:5741:0:b0:3f6:c609:e9da with SMTP id 1-20020ac85741000000b003f6c609e9damr9107962qtx.44.1686250648367; Thu, 08 Jun 2023 11:57:28 -0700 (PDT) Received: from ?IPV6:2607:fea8:51df:4200::ca58? ([2607:fea8:51df:4200::ca58]) by smtp.gmail.com with ESMTPSA id x12-20020ac84d4c000000b003e302c1f498sm561839qtv.37.2023.06.08.11.57.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jun 2023 11:57:27 -0700 (PDT) Message-ID: Date: Thu, 8 Jun 2023 14:57:26 -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 1/4] Fix floating point bug in fold_range. X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-12.3 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_H5, RCVD_IN_MSPIKE_WL, 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768162038874531530?= X-GMAIL-MSGID: =?utf-8?q?1768162038874531530?= We currently do not have any floating point operators where operand 1 is a different type than the LHS. When we eventually do there is a bug in fold_range. If either operand is a known NAN, it returns a NAN of the type of operand 1 instead of the result type. This patch sets it to the correct type. Bootstraps on build-x86_64-pc-linux-gnu with no regressions. Pushed. Andrew From ff0ef34aa04f7767933541f58f016600a3462c84 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Wed, 7 Jun 2023 14:03:35 -0400 Subject: [PATCH 1/4] Fix floating point bug in fold_range. We currently do not have any floating point operators where operand 1 is a different type than the LHS. When we eventually do there is a bug in fold_range. If either operand is a known NAN, it returns a NAN of the type of operand 1 instead of the result type. * range-op-float.cc (range_operator_float::fold_range): Return NAN of the result type. --- gcc/range-op-float.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index a99a6b01ed8..af598b60a79 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.cc @@ -57,7 +57,7 @@ range_operator_float::fold_range (frange &r, tree type, return true; if (op1.known_isnan () || op2.known_isnan ()) { - r.set_nan (op1.type ()); + r.set_nan (type); return true; } -- 2.40.1