From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 1A6213858C83 for ; Fri, 14 Oct 2022 14:27:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1A6213858C83 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=1665757620; 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: content-transfer-encoding:content-transfer-encoding; bh=pDMZYvR2AcLuGFyDtclaOonyOh1lS2FRywgqOn7pJaU=; b=QgfWNLGl8kCsVx7/zO1vUcELG1iO7LEMCx3SCxY9IfS3Ks3c/s+WyuhR53R9xTmWEmOhgr VrszjoujdKQLEhD4eGdQn6TSBBvicp905d6bVS5DvCL7t0zFAhXCkg/yuNUHj9kSmirYx9 0g42Rsk13Qbts0iDHzfj24ff1IWtkFs= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-156-RbOTNL42NgiGncI95pT6Pw-1; Fri, 14 Oct 2022 10:26:59 -0400 X-MC-Unique: RbOTNL42NgiGncI95pT6Pw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3C2D129324AA for ; Fri, 14 Oct 2022 14:26:59 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.195.163]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D62AD40F9D40; Fri, 14 Oct 2022 14:26:58 +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 29EEQuog671507 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 14 Oct 2022 16:26:56 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 29EEQun4671505; Fri, 14 Oct 2022 16:26:56 +0200 From: Aldy Hernandez To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED] Drop -0.0 in frange::set() for !HONOR_SIGNED_ZEROS. Date: Fri, 14 Oct 2022 16:26:50 +0200 Message-Id: <20221014142652.671475-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.0 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Similar to what we do for NANs when !HONOR_NANS and Inf when flag_finite_math_only, we can remove -0.0 from the range at creation time. We were kinda sorta doing this because there is a bug in real_isdenormal that is causing flush_denormals_to_zero to saturate [x, -0.0] to [x, +0.0] when !HONOR_SIGNED_ZEROS. Fixing this bug (upcoming), causes us to leave -0.0 in places where we aren't expecting it (the intersection code). gcc/ChangeLog: * value-range.cc (frange::set): Drop -0.0 for !HONOR_SIGNED_ZEROS. --- gcc/value-range.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 26a2b782e2c..86550f158b8 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -324,6 +324,14 @@ frange::set (tree type, m_neg_nan = false; } + if (!HONOR_SIGNED_ZEROS (m_type)) + { + if (real_iszero (&m_min, 1)) + m_min.sign = 0; + if (real_iszero (&m_max, 1)) + m_max.sign = 0; + } + // For -ffinite-math-only we can drop ranges outside the // representable numbers to min/max for the type. if (flag_finite_math_only) -- 2.37.3