Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260121023125.GG6263@brightrain.aerifal.cx>
Date: Tue, 20 Jan 2026 21:31:26 -0500
From: Rich Felker <dalias@...c.org>
To: Demi Marie Obenour <demiobenour@...il.com>
Cc: musl@...ts.openwall.com, Xan Phung <xan.phung@...il.com>
Subject: Re: [PATCH v1] wctype: reduce text size of iswalpha & iswpunct
 by 53%

On Tue, Jan 20, 2026 at 07:56:05PM -0500, Demi Marie Obenour wrote:
> On 1/20/26 10:09, Rich Felker wrote:
> > On Tue, Jan 20, 2026 at 01:35:26AM +1100, Xan Phung wrote:
> 
> (snip)
> 
> >> +
> >> +int iswalpha(wint_t wc) {
> >> +	unsigned *huffm = (unsigned *)(table + PAGEH), target;
> > 
> > The aliasing violation here isn't acceptable. Is there any good way to
> > avoid it? I've only skimmed this submission so far; I assume the
> > motivation is doing the popcount across 4 bytes, but I don't yet
> > understand why popcount was chosen as the way of storing an index.
> 
> Do compilers optimize using memcpy() for type-punning?

Yes, except that we've suppressed that with -ffreestanding which
implies -fno-builtin. To get it back we'd need to make a musl-internal
way that memcpy calls get expanded to __builtin_memcpy. Which has been
kinda on the wishlist for a while, but it does require some care to
suppress it in certain TUs where it could result in circular
definitions.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.