From: Jeff Law <jeffrey.law@oss.qualcomm.com>
To: Jan Dubiec <jdx@o2.pl>, gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: Re: [REPOST][PATCH v4] H8/300: sim: Fix simulator hang caused by qsort on Windows/MinGW
Date: Thu, 8 Oct 2026 21:32:11 -0600 [thread overview]
Message-ID: <5cb1558e-2dbe-4457-a4a7-dfa12ca569f7@oss.qualcomm.com> (raw)
In-Reply-To: <19ebaeb7-1eb1-4e02-a224-c65f1dbdda2c@o2.pl>
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
prev parent reply other threads:[~2026-10-09 3:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 6:05 Jan Dubiec
2026-10-08 2:04 ` Jeff Law
2026-10-09 3:14 ` Jan Dubiec
2026-10-09 3:32 ` Jeff Law [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5cb1558e-2dbe-4457-a4a7-dfa12ca569f7@oss.qualcomm.com \
--to=jeffrey.law@oss.qualcomm.com \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=jdx@o2.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox