From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id H1nKJq1gyGqe+RsAWB0awg (envelope-from ) for ; Thu, 08 Oct 2026 23:34:05 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=IZYfdc5K; dkim=pass (2048-bit key; unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=BVI0Nkim; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 6594C1E047; Thu, 08 Oct 2026 23:34: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=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 293891E047 for ; Thu, 08 Oct 2026 23:34:04 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4A4174BA2E18 for ; Fri, 9 Oct 2026 03:34:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4A4174BA2E18 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=IZYfdc5K; dkim=pass (2048-bit key, unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=BVI0Nkim Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by sourceware.org (Postfix) with ESMTPS id 574784BA2E03 for ; Fri, 9 Oct 2026 03:33:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 574784BA2E03 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=oss.qualcomm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oss.qualcomm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 574784BA2E03 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791516818; cv=none; b=pAmJCGijoUSbfaSYAVaGhcd3avHaP2O/FsJAO0AwthgMKY+PuLXPzdC63XO+IujjyKvywppwLLHsQmREZ2YTTE0BiJSda+N57JvPMHnAZDJBvV/KhHZp0MoF71Fx9psTFQd4TggWsKfzKmXNJa/Y0XVdpFF382+dCjwSqWd9kW4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791516818; c=relaxed/simple; bh=7zMtwuXjrMNNUEeIUit060bFrZK0t2GY6UwQVDrvv8c=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version: Subject:To:From; b=hliaTnhG7vBpZiN/vDPYC1bbePZfhIQM1L85ei8iXHRZaD2RBIL/Rj9VtQgYB1G34tm/l4j2JVxJk75TpvH94cFb9HobcmzpV8E8hFOPqO7EATohrX4BU1SV9Z5C5zgDN2/dAklM52y9FTjXMvfs6ObygR6220QJofAoK2N09dg= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=IZYfdc5K; dkim=pass (2048-bit key, unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=BVI0Nkim DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 574784BA2E03 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6993HV953769003 for ; Fri, 9 Oct 2026 03:33:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= guZ9hWpDQBAGhr3oWYoLOQ6+1kVjKzFyIRobFx+xHZs=; b=IZYfdc5K+ZONDkk0 uPh6mY6niIAw+jc+uhwx0K2j+6SLSM9pj+ml6tcwFUl40gpx8eNXb4EoCmC/Mg7z bpCyewuvKV7u5RyBCrcPVFPVtC7OYAtL/ofEluXKs9oggZmGqJyNaKJhVXmwdF4B 82DXsEqt724zZ+UjXVfff/S5NL4cMsBBTlvbjX2X2MecdB5wv6snz0mWEZyRTAUh brABDSLPT0KkmDQmq/NuqExI9jIt1LQGppzqT/ul3eXp0/3vdSyLS8aL/FKMpM95 /OZYwKiE/Tg9BmkcXQp2y8weA65t44QnDdBvwFp1Jiuc8dZmO0QRvjUF5dukBP8T r7NGFA== Received: from mail-dl1-f71.google.com (mail-dl1-f71.google.com [74.125.82.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4h6fxu1p6r-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 09 Oct 2026 03:33:34 +0000 (GMT) Received: by mail-dl1-f71.google.com with SMTP id a92af1059eb24-14fed306427so2752614c88.1 for ; Thu, 08 Oct 2026 20:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1791516814; x=1792121614; darn=sourceware.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=guZ9hWpDQBAGhr3oWYoLOQ6+1kVjKzFyIRobFx+xHZs=; b=BVI0Nkim8Xq20ll7/O5v2wt0tsT1SCp0bCYSQVMu8VIoXQiHCUTsNyTXZXBgFH5Gow An1pulGQVyHAdG5ro26sD99BjISgOEohLifWaATX+c8RMEhIquN2rcoOBHuhg3SokYHp wv6B0uZ/5xvA/pbKONVKDTaLPsOg0XdbJMDcGPoYUVl6lmgS87Dre81bUdYiNgBgN3/1 ni7pqbG8vR4tiO+Ov6kraqB5W90FAfMrX5vxd4SPwtNMzMNg8OFC9RN/fXkMPSs3tv6o qgAggPTmhMuEtWqRBF9bYouHXzrE1+/D137d7kJPmMAEKs+ZC4pJBXzQ1mDM7mEVSrNh uzSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791516814; x=1792121614; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=guZ9hWpDQBAGhr3oWYoLOQ6+1kVjKzFyIRobFx+xHZs=; b=XMavUtOzs7n8Bd+MRGj+GyDEp1jCfXm9vocoNiFuxTucG8OEID3iaPQ+MEx1+E57BO ZoDNnfBGIZEeEiD8xLWWMLHzhAev4ejBByVglfJsPJLeJ5SbRXRTvcT6aHpWgIz/vey+ jyLr/nQzwpsf9zCKeH1lcFl1nSRyh6gCTI8FIJUvW0u3HxuNfeh2NWqqULX/+nOpguco Sxl9yJ7X23svaLML/n58Pxr6CdUQjDSNaXjwlV4pJWnriFvidQAbD27YnLnnUlNO9B51 bFQTZHtsjyvOvcD0DTNuD4mqUj79fxTdAuEKcJ/UTzU54qjeOHoOUKj+ezQLqgxkbY7U tdSA== X-Forwarded-Encrypted: i=1; AKwUvBxCezri7+6ObW5d5z1kVdHsnEpl9ppjiEBksJogBWbDknQJPTf/zpMm3SXBjJAgRfBPz1sJ/RWCcKlQ9g==@sourceware.org X-Gm-Message-State: AFuF++kOjTiXTKfKkwgMiXJQFEVT7TE3XXY82817sl+9wUaaMNKiB+e0 8atoVZ0QUB0Vl4UY0btUXvMnkg8xnLu0r4jzj6NxBWyF62Y73mFeuz2hlL+7+qcLX1fo4hypD+N aOlff62nnbJNm/DaZdrUEQOzwYASxVRANBLXmKG/EWo6vKVfY5PzvC24M2tnU6iqV X-Gm-Gg: AYBFou1F5O5K4HhyNyjyCk+N76Uh8HscGpXDHKsBcrAZUpvFWwPB1xF7c/Hno7WMKrv Xu250DoezitNg/AFzpxy998J73JTaQZZYx5NHy+WmC6i7s/tQPftU41HoTJdxEPvbuBUUsX/OFo w+4Ee0i3mUekU+lW1+qhVafRSF8tXBBX0mw+4AwBErYinEJIWD+h5waTUkLemAqwt1o3KVEn9AW TVxA1yfis4Ix9oU3GKHGv0L0btnE2bazlyHXW1Q8o0HKX0frpaRtx/Bv2JbKDdu1sZ6xcONfkTR 2H0OzwT8hacJAWEaLzk+8j17Abja4FHq5v2Uh/65B82hOLEwKLcnbktZXJkZT/qL9TIKhnoLSf6 wKWDgVfq5F+fnHw== X-Received: by 2002:a05:7022:158b:b0:143:298f:33ba with SMTP id a92af1059eb24-16a6203dcd3mr1005330c88.46.1791516813855; Thu, 08 Oct 2026 20:33:33 -0700 (PDT) X-Received: by 2002:a05:7022:158b:b0:143:298f:33ba with SMTP id a92af1059eb24-16a6203dcd3mr1005304c88.46.1791516813339; Thu, 08 Oct 2026 20:33:33 -0700 (PDT) Received: from [172.31.0.30] ([136.38.201.137]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-169a1becf08sm2501938c88.5.2026.10.08.20.33.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Oct 2026 20:33:33 -0700 (PDT) Message-ID: <5cb1558e-2dbe-4457-a4a7-dfa12ca569f7@oss.qualcomm.com> Date: Thu, 8 Oct 2026 21:32:11 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [REPOST][PATCH v4] H8/300: sim: Fix simulator hang caused by qsort on Windows/MinGW To: Jan Dubiec , gdb-patches@sourceware.org Cc: Andrew Burgess References: <20261005060545.242055-1-jdx@o2.pl> <19ebaeb7-1eb1-4e02-a224-c65f1dbdda2c@o2.pl> Content-Language: en-US From: Jeff Law In-Reply-To: <19ebaeb7-1eb1-4e02-a224-c65f1dbdda2c@o2.pl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDA5MDAxMyBTYWx0ZWRfX0vCaPYlSfVQO T5qEE3mpzg9c4ZfYBAe050On6ANHo0RBXGKxD36nqAEU7r/PNFn6h3vajrahUOLPkLW6mlmfhjp BU+pIkBWh8dvX2K9ljvAY5dxWOr2ClseA6a6qZlh4mQFflOSK39JbdS56s6QouKfIb1u4HEwcpa 1Bcbu9mCLq23iCtx0JtNrL9CxayL99nm893aP/9tSU8KqqvDUCozaxS+ygK78ccoIlwD5yShDvH 2KkyUzxFravMPJk5FTskV6WPrNJ/naQgISgk2DB4Yr874LKqWllvC0HY7CynXWQL/tkRwluRhsj uUSsamq+PwM+X0KZe42LUYTfG2y48Tkx7uSOKkSeM0W2dqhK8t8DNebH7CSAXQDb70Qd+ME2c/f ga6wb2d39wvIXPUXharFhcL/I4GwELeshYejmlprXl7ii0pAqtDFPSoezf/A2a6tBgigMMO6k6T 2w4K+HtTLXXTlN1nFUg== X-Authority-Analysis: v=2.4 cv=QbjzLcbv c=1 sm=1 tr=0 ts=6ac8608e cx=c_pps a=JYo30EpNSr/tUYqK9jHPoA==:117 a=asGLMfRmzhnGNxaIYohjRg==:17 a=IkcTkHD0fZMA:10 a=660iZSQnnn4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=qyHfUHV1EBQANTOjKXQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=Fk4IpSoW4aLDllm1B1p-:22 X-Proofpoint-GUID: j-R66McC-jsOBztOHHLn-5NdvKBm9TN2 X-Proofpoint-ORIG-GUID: j-R66McC-jsOBztOHHLn-5NdvKBm9TN2 X-Proofpoint-Spam-Info: AW1haW4tMjYxMDA5MDAxMyBTYWx0ZWRfXyfWw2Ovg5NmK qGWLydMfKTpBirSYVfd6iqzrxkinKK+QfnZYInCN6XtNiGU4/VcNUUsVeVgLZYD+G6rIBZw5tGP CHUM/RRi2Xz0A3DZR1FKi/IJJqw/P9s= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-10-09_02,2026-10-08_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 bulkscore=0 phishscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2610020000 definitions=main-2610090013 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 10/8/26 9:14 PM, Jan Dubiec wrote: > On 8.10.2026 04:04, Jeff Law wrote: > [...] > >> This seems generally sensible to me.  I'd probably kill that ldm/stm >> special case, particularly if the new comparator avoids the problem. > > I'm not sure what you mean by "new". That said, using a stable sorting > algorithm avoids the problem, but only incidentally. Then we probably need to further improve the stability of the sort. > >> I'd instead be more interested in tripping an assert if we ever have >> two things compare equal > An assert doesn't make sense here because equal comparisons occur "all > the time". For H8/300H, the comparator is called 80919 times and > returns zero 22434 times. For H8S, the corresponding numbers are > 94315/26963, and for H8SX, 79552/23240. The h8_opcodes[] array > contains 8484 elements. Those would all seem like problems waiting to happen.  If qsort ever returns 0, then you've got the potential for an unstable sort. Jeff