From patchwork Thu Oct 6 06:23:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1753 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp166354wrs; Wed, 5 Oct 2022 23:24:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4wTLRX+qwEDDfcvwfA0xODnvMBK6dAB5+wxkQJbZnVsbjd2vljHBgxd7EG1WuwmBNZdvD1 X-Received: by 2002:aa7:c78d:0:b0:454:fe1d:8eb1 with SMTP id n13-20020aa7c78d000000b00454fe1d8eb1mr3099112eds.59.1665037466223; Wed, 05 Oct 2022 23:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665037466; cv=none; d=google.com; s=arc-20160816; b=ZY1R/d5lv9U0PBcvXexry5y/OwMxoiwIzn8yqMLd3y6SRJoQ7It+vi7yKymK550z2s 0baCfKCUDUICmpf1llnHTEQR9LqlPDO/xuVfcC1b/t6EahIpL73GkpHD9cXabbK1EBvT NhLgTh1W6GqivqiQgg4hDOqFVcR+RQVOz+//hWpRMnUWnj0ddwal7N+ayljSF1x2A+lt DrM0a50bGshWToajp6G7ebXUA4snU4T/5+RGSiDIQhCK7ODXW9XOjF9boPTNneaRDv66 SHuTH1+ekP8t65dBajG33ozcSkr8mLLTihr2vpyLm+4Km8ZJMfpsT8glDLO52zLMvMdQ 3MGw== 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-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=oPgsVwsLctpXGq+ml5XOiO1/UIqgQBUzrgN6b0Qr0QQ=; b=bgIdiJQaZ02ztuJBZiTWT4Du9WNGQ0eUlww1umd+auCRlWMLzK4ontt1Q/s7sa/afy qSCqqbmlxWbEy7sXkOXu2VJhdBkgJDZvdHhW+SafWnCddIc2puOlCSXrGcmJqUobwNIF nxRnAKcXUDjsU/yKyJhZRFWLIFYUBa2aC54/UJ2VKl+7ZDVsfYb4WdoY0rXBMWS2Yu1G EUfYOMG54Ph1Db+tp0iWNWaHxMzXF+d4w77i9U1+7524viHDOcm5+IpaTbyHfgfmOrsT HiWAVvnKvm1y6VZ2DkC7ZMN/tt6QJclKJjYetzTtrL1p0QcnNPL5kowHTj0jBBzQYhqW E97w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=aMzK9sfA; 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 m8-20020a50ef08000000b0045731196587si14816282eds.64.2022.10.05.23.24.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 23:24:26 -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=aMzK9sfA; 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 E9AA3383FB9D for ; Thu, 6 Oct 2022 06:24:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E9AA3383FB9D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665037448; bh=oPgsVwsLctpXGq+ml5XOiO1/UIqgQBUzrgN6b0Qr0QQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=aMzK9sfA5icpGFh5cTnazejGOF1zvLmZllUsshvkHpIAj2D8hwJFex3Dr+jvJt2y8 AvS0awWgjXsljlgFtGlqD7OrD+6J5rCPFYIycLqRegvqFFvfJHsyrxqxkZ5unDOUkj Ay12HFTokvaleWmpNIO3VcTgh6v78V2qoigWBKQo= 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 08C64384D168 for ; Thu, 6 Oct 2022 06:23:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 08C64384D168 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-260-X4h5KyYbMOmRljSxC_uyLA-1; Thu, 06 Oct 2022 02:23:23 -0400 X-MC-Unique: X4h5KyYbMOmRljSxC_uyLA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A7550101CC62 for ; Thu, 6 Oct 2022 06:23:22 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.138]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4478F39DB3; Thu, 6 Oct 2022 06:23:22 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.1/8.17.1) with ESMTPS id 2966NJPP1710014 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 6 Oct 2022 08:23:19 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 2966NJAW1710013; Thu, 6 Oct 2022 08:23:19 +0200 To: GCC patches Subject: [COMMITTED] Do not double print INF and NAN in frange pretty printer. Date: Thu, 6 Oct 2022 08:23:16 +0200 Message-Id: <20221006062318.1709996-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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: Aldy Hernandez via Gcc-patches From: Aldy Hernandez Reply-To: Aldy Hernandez 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?1745918326471392604?= X-GMAIL-MSGID: =?utf-8?q?1745918326471392604?= gcc/ChangeLog: * value-range-pretty-print.cc (vrange_printer::print_real_value): Avoid printing INF and NAN twice. --- gcc/value-range-pretty-print.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/value-range-pretty-print.cc b/gcc/value-range-pretty-print.cc index 8cbe97b76fd..3a3b4b44cbd 100644 --- a/gcc/value-range-pretty-print.cc +++ b/gcc/value-range-pretty-print.cc @@ -123,7 +123,11 @@ vrange_printer::print_real_value (tree type, const REAL_VALUE_TYPE &r) const char s[100]; real_to_decimal_for_mode (s, &r, sizeof (s), 0, 1, TYPE_MODE (type)); pp_string (pp, s); - if (!DECIMAL_FLOAT_TYPE_P (type)) + if (!DECIMAL_FLOAT_TYPE_P (type) + // real_to_hexadecimal prints infinities and NAN as text. No + // need to print them twice. + && !real_isinf (&r) + && !real_isnan (&r)) { real_to_hexadecimal (s, &r, sizeof (s), 0, 1); pp_printf (pp, " (%s)", s);