From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id TJUZKG3382qMDgEAWB0awg (envelope-from ) for ; Wed, 11 Nov 2026 00:04:45 -0500 Received: by simark.ca (Postfix, from userid 112) id 8C6C51E043; Wed, 11 Nov 2026 00:04:45 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 A8CBD1E043 for ; Wed, 11 Nov 2026 00:04:44 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D4B284BA7986 for ; Wed, 11 Nov 2026 05:04:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4B284BA7986 Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by sourceware.org (Postfix) with ESMTPS id 059C64BA2E22 for ; Wed, 11 Nov 2026 05:04:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 059C64BA2E22 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=symas.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dubner.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 059C64BA2E22 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=166.84.1.89 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794373460; cv=none; b=OV+jgBTWIK6j2nqXl9EzypenHC9zzd5hF8d+Wy6IeC2RCbb6Htdm2P6+H1TrTWgYL/h+mebDc/DtGryxQTtaVrdgu2vRhxJx/8NXOsyk2uOfCam5wYakYLoe+KQ6UZg0GPyd+5nzsonA5AooBadtkEnzpGes1uQuPMphICy+kso= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794373460; c=relaxed/simple; bh=MfeIcPSx1TPIvHtYY/KrycetHTYqREDA1vsGk08lwAo=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=cfBssDGz9Tlx1IPgtsCg/vq4k/j75xpGQ+Zh+Q5XiRqg89soGQj8FgEfhbvlurN1gHS38mqBjGTmGMys3E59rgVuMQjCzA9W62wU3oRPkPWUlTfoq8yMjQinmAWGXjELFIUzjaVUMJUUtdZpwGsN9az8HV3nknJdl+nb/x5zr+c= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 059C64BA2E22 Received: from doobie (unknown [67.245.74.220]) by mailbackend.panix.com (Postfix) with ESMTPSA id 4jPWds5vvqz45K9; Wed, 11 Nov 2026 00:04:17 -0500 (EST) Received: by doobie (Postfix, from userid 1000) id 4E2B228E902A; Wed, 11 Nov 2026 00:04:17 -0500 (EST) From: Robert Dubner To: gdb-patches@sourceware.org Cc: stephan.rohr@intel.com Subject: [PATCH 0/2] gdb: Preserve signed zero in conversions and unary negation Date: Wed, 11 Nov 2026 00:04:10 -0500 Message-Id: <20261111050412.3340227-1-rdubner@symas.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 This series fixes two places where GDB loses the sign of floating-point zero. The first patch preserves signed zero in the MPFR target encoder. The encoder currently returns for zero before examining its sign. Process the sign first, using mpfr_signbit, while retaining the existing zero encoding for formats without signed-zero support. The second patch corrects floating-point unary negation. Computing zero minus the operand does not negate positive zero. Multiply floating-point operands by -1 instead, leaving the integer and fixed-point paths unchanged. Together, these changes preserve the distinction between assigning integer -0, which produces positive zero, and assigning floating-point -0. or -.0, which produces negative zero. adds DejaGNU coverage for literal types, assignments, both zero signs, nested negation, and integer controls. Robert Dubner (2): gdb: Preserve signed zero in MPFR target conversions gdb: Preserve signed zero in floating-point unary negation gdb/target-float.c | 138 ++++++++++++++++++++++++++- gdb/testsuite/gdb.base/float-neg.c | 30 ++++++ gdb/testsuite/gdb.base/float-neg.exp | 73 ++++++++++++++ gdb/valarith.c | 8 +- 4 files changed, 243 insertions(+), 6 deletions(-) create mode 100644 gdb/testsuite/gdb.base/float-neg.c create mode 100644 gdb/testsuite/gdb.base/float-neg.exp base-commit: 9db3b515b964c1bbdc4d20c1202fbf27719be269 -- 2.34.1