From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yqmbLrGflWq7yxcAWB0awg (envelope-from ) for ; Mon, 31 Aug 2026 11:37:21 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=o2.pl header.i=@o2.pl header.a=rsa-sha256 header.s=20241105 header.b=WjIF/SC+; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id A27591E166; Mon, 31 Aug 2026 11:37:21 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 F0FDA1E033 for ; Mon, 31 Aug 2026 11:37:19 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7AF444BA2E32 for ; Mon, 31 Aug 2026 15:37:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7AF444BA2E32 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=o2.pl header.i=@o2.pl header.a=rsa-sha256 header.s=20241105 header.b=WjIF/SC+ Received: from mx-out.tlen.pl (mx-out.tlen.pl [193.222.135.148]) by sourceware.org (Postfix) with ESMTPS id 3516C4BA2E2B for ; Mon, 31 Aug 2026 15:36:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3516C4BA2E2B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=o2.pl Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=o2.pl ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3516C4BA2E2B Authentication-Results: sourceware.org; arc=none smtp.remote-ip=193.222.135.148 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788190616; cv=none; b=hZvuBhwP2ZcokqCCCnb9mSLzryp1ts0aWOOQTfIxCEYSmARinQfxgDiuj7xNE4CVEPaK5yACtP0agtpsn/BnCmTxJgGRoachAF2szBPan7t4JUbTRtsJcRFnmUcse97lfiwPk6yZyNPRoDZxTSOC47VJAqLQOFAAoe3n+vlsQcI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788190616; c=relaxed/simple; bh=FwL9axemo9z7L/qGPlU+YpV6t5AIxMHorce0FRKfC4o=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=kQ5Ejz5CUpnHOq4/EYbnOMjz9wuxTi7Zkz6AB1gBmXm8J0pAueq8cT42GFYezvmhUxEjaf9ML5ZNP8GqoABmk7tgYa57I7eDm+dYXbOD+l7dFQLB1X9gPtsX5LFw8vAA7ire4IWkfgxgG9bPBbKX8fl4BpdbOpltfyBZIIhieYE= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=o2.pl header.i=@o2.pl header.a=rsa-sha256 header.s=20241105 header.b=WjIF/SC+ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3516C4BA2E2B Received: (wp-smtpd smtp.tlen.pl 35118 invoked from network); 31 Aug 2026 17:36:52 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=20241105; t=1788190612; bh=zvugg4LFPUBGlL00cv/G6taQaN9fF858ekh+z/V/68E=; h=Subject:To:Cc:From; b=WjIF/SC+/lxEHWojNymfnxmaMEyJleU7tx3BHCS01FlVWbwpke/27JkCPX7wYOZEc HKN7vk/jLP6/mjhUJfEKx/LrxPiJPkJS3MORo3W4Qf+AX6bgCU47vUUa6jAUIemqSB +Ub40rfijs1FwaY4IWGlux9rq79nuRqDoacSScjaBIeYdB5HpBvzEdBdTSMa7Zuz/u aRkM9CBjOrZcVf3EqAD4bJUVw2mOfaW7z/dDxO+1f+/+uIiXG9UX/uNsG54pth2aYU izuE1YK5sihQ1NfbMVPdX1fBpNI2hKOJ7b1ooZwiyFSb/j5gTZUCpDMrOX6tNMnC1E 0gr1pj6FDVb8Q== Received: from [192.168.0.1] (ip-94-42-228-191.multimo.pl [94.42.228.191]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with TLS_AES_256_GCM_SHA384 encrypted SMTP for ; 31 Aug 2026 17:36:52 +0200 Message-ID: <9c86da7c-c394-4f58-b8fa-6c265ad37952@o2.pl> Date: Mon, 31 Aug 2026 17:36:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] H8/300: sim: Fix simulator hang caused by qsort on Windows/MinGW. To: Jeff Law , Tom Tromey Cc: gdb-patches@sourceware.org References: <20260822110423.1569154-1-jdx@o2.pl> <878q5rbngh.fsf@tromey.com> <140cc872-432a-4b4d-85d6-c93ac879bafb@o2.pl> Content-Language: pl From: Jan Dubiec In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-WP-MailID: c3c2e0f4247513f101bb291df8912827 X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000002 [0TFW] 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 On 31.08.2026 16:09, Jeff Law wrote: > > > On 8/29/26 7:40 PM, Jan Dubiec wrote: >> On 27.08.2026 17:19, Tom Tromey wrote: >>>>>>>> "Jan" == Jan Dubiec writes: >>> >>> Jan> So I think the best solution is to use a sorting algorithm known >>> to be >>> Jan> stable on every host, e.g. the insertion sort implementation >>> from my >>> Jan> previous message. >>> >>> Would it be possible to change the comparison function to be stable? >> >> It is impossible by definition, because stability is a property of the >> sorting algorithm, not the comparator. However, the comparator can be >> modified in such a way that an unstable sorting algorithm produces a >> “good enough” result. > When the comparator returns "0", the order of those two elements is > unspecified  in the final output of qsort.  That introduces host > dependencies in behavior that we very much want to avoid. > > The traditional way to fix that is to fix the comparator to not return 0 > by introducing additional sort keys.    He may have been a bit imprecise > by saying "change the comparison function to be stable", but the intent > is clear and consistent with how this issue has been handled through the > decades. OK, then I’ll repost the comparator patch in a new thread in a few hours. /J.D.