This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/19652] should always optimize constant second argument to strspn & Co. at compile time
- From: "falk at debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jan 2005 09:03:09 -0000
- Subject: [Bug middle-end/19652] should always optimize constant second argument to strspn & Co. at compile time
- References: <20050127071821.19652.melkov@comptek.ru>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From falk at debian dot org 2005-01-27 09:02 -------
(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.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19652