strspn, strcspn, strpbrk functions make a bitmap out of their second argument and then process their first argument using that bitmap. If the second argument is a constant string, that bitmap should be built at the compile time, and strspn call be replaced with some intrinsic function that can use that bitmap.
(In reply to comment #0) > strspn, strcspn, strpbrk functions make a bitmap out of their second argument > and then process their first argument using that bitmap. > If the second argument is a constant string, that bitmap should be built at the > compile time, and strspn call be replaced with some intrinsic function that can > use that bitmap. Well, with that we'd be wandering off far into libc land. While this kind of optimization is nice, I wouldn't really want to have strspn code for 40 platforms in gcc to maintain (and if you're that desperate for speed, you want platform-specific code). Alternatively, you could try to convince your libc providers to include such functions in their libc, and then we might implement calling them.
I am going to agree with Falk here, this is a hard problem to solve inside gcc. Again talk with you libc provider.