From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id fpVwKKkd4mp2iD4AWB0awg (envelope-from ) for ; Wed, 28 Oct 2026 12:07:05 -0400 Received: by simark.ca (Postfix, from userid 112) id 9067B378003; Wed, 28 Oct 2026 12:07:05 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 02A2A378002 for ; Wed, 28 Oct 2026 12:07:04 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0F8F64BA23CE for ; Wed, 28 Oct 2026 16:07:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0F8F64BA23CE Received: from zmcc-4-mx.zmailcloud.com (zmcc-4-mx.zmailcloud.com [34.203.170.87]) by sourceware.org (Postfix) with ESMTPS id 9C2584BA23E9 for ; Wed, 28 Oct 2026 16:06:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9C2584BA23E9 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=symas.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=symas.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9C2584BA23E9 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=34.203.170.87 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793203581; cv=none; b=xIkGMc5f+A5U0D9Ryoeti/FTbgxb+EcHemFhhQpPv2yXM47rNWMzSsU0RmSJfjUPTDOYa8K7zvXf+flEI/n/jwLm+I50ZB3I1DUIr0Y03GJ5pPYc1QZyy3UY2a4/PqoT0ch84U4M/B8nbeYPaIbk6RkrehSMBvEPNf2V98FxV4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793203581; c=relaxed/simple; bh=nA8P+o/TY5qyfAz4S7alYokLcgHXCIzOt6cAgWjbv5Y=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=O8GLkXrofLtQTGGLHzPMPOTzyvlikc/+n1ZTFQ0QLmdXwgE4XMnr8bAvs89zmJIkrk3w2xMm6swjDtRLoFZN+h3RLkjn2ENd+ArgGU9PEdZmJIquV8tPJMttILAi818Dcz+uuePRQ5nQZqt+KPHfeHKFL2Th81cQ6DBC2LVsvLs= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C2584BA23E9 Received: from zmcc-3.zmailcloud.com (ec2-3-15-255-223.us-east-2.compute.amazonaws.com [3.15.255.223]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by zmcc-4-mx.zmailcloud.com (Postfix) with ESMTPS id 75E0E781D323 for ; Wed, 28 Oct 2026 11:06:20 -0500 (CDT) Received: from zmcc-3.zmailcloud.com (localhost [127.0.0.1]) by zmcc-3-mta-1.zmailcloud.com (Postfix) with ESMTPS id 5DE5F1043EBE for ; Wed, 28 Oct 2026 11:06:20 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by zmcc-3-mta-1.zmailcloud.com (Postfix) with ESMTP id 470E81043EBF for ; Wed, 28 Oct 2026 11:06:20 -0500 (CDT) Received: from zmcc-3.zmailcloud.com ([127.0.0.1]) by localhost (zmcc-3-mta-1.zmailcloud.com [127.0.0.1]) (amavis, port 10026) with ESMTP id vxspkq4FZpWp for ; Wed, 28 Oct 2026 11:06:20 -0500 (CDT) Received: from zmcc-3-mailbox-1.zmailcloud.com (zmcc-3-mailbox-1.zmailcloud.com [172.31.18.168]) by zmcc-3-mta-1.zmailcloud.com (Postfix) with ESMTP id 320AB1043EBE for ; Wed, 28 Oct 2026 11:06:20 -0500 (CDT) From: Robert Dubner To: Subject: [PATCH 0/4] gdb: Floating-point assignment corner cases. Thread-Topic: [PATCH 0/4] gdb: Floating-point assignment corner cases. Date: Wed, 28 Oct 2026 11:06:20 -0500 (CDT) Message-ID: <1af701dd66f6$460e1960$d22a4c20$@symas.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 X-Mailer: Zimbra 10.1.21_GA_4899 (Zimbra-ZCO/1951 (10.0.26200 en-US) P6c38 T3694 R26845) Thread-Index: Ad1m9gyJ6V3xVI2rTv+iiL8unc8Q5w== Content-Language: en-us X-Zimbra-Message-Verification: hash=SHA256; guid=OTkyMGEwMTYxZDJjNTcwNGU0MzkzZWM1NWY5ZWY1MGU1YTQwMjEzYTM4ZDE3MjBkYjc5NGE5ODEwMjU5M2MzNw== X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org To: gdb-patches@sourceware.org Subject: [PATCH 0/4] gdb: Floating-point assignment corner cases. While using OpenAI's Codex to develop test cases for the COBOL extensions to GDB, a series of flaws in the code of gdb/target-float.c were exposed. This message explains the problems in broad; the four additional messages contain patches to fix them. The discussions of testing refer to my local repository, which contains tests pertaining to COBOL that don't appear in the GDB repository. I include those descriptions here to provide some assurance that the patches here have been tested. This is my first attempt to contribute to GDB, and so I assume the form of these patches isn't correct. Please let me know what I can do better; I will endeavor not to have to be corrected more than twice. (I can't guarantee that just once will work, but I will try.) The FSF has on file my releases, both from me as an individual and from my employer, to provide contributions to GDB. Given this program: ~~~~~~~~~~ double negative_zero = -0.0; __float128 quad; __float128 tiny = 0x1p-16494Q; __float128 above_half = 0x1.00000000000000000001p-25Q; _Float16 half; int main (void) { return 0; } ~~~~~~~~~~~ The patch repairs gdb assignments as follows: print quad=negative_zero currently results in 0. After the patch, it shows -0. print tiny * 1 results in 0. After the patch, the result is the subnormal 6.47517511943802511092443895822764655e-4966 print half = above_half results in 0. After the patch, the result is 5.9605e-08 print print half = -1 results in 1. After the patch, it's -1.