[PATCH 1/5] string: Add fallback implementation for ctz/clz

Wilco Dijkstra Wilco.Dijkstra@arm.com
Mon Sep 1 21:34:24 GMT 2025


Hi Cristian,

> The compiler claims this builtins are __attribute__(const)
> functions..if the libgcc version depends on some kind of state table
> then it is not a const function,
> still a bug isn't it ? This does not happen elsewhere because it has a
> clz pattern..does s390x really not have one?

A const function can do whatever it wants as long as it returns the same
value for the same input. We consider TLS lookups const eventhough it
may call the dynamic linker (the state is internal and not observable).
So a simple const table lookup is not a bug.

Cheers,
Wilco


More information about the Libc-alpha mailing list