public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/67014] New: builtin_tolower is inefficient.
@ 2015-07-26  4:53 neleai at seznam dot cz
  2021-06-04 21:45 ` [Bug ipa/67014] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: neleai at seznam dot cz @ 2015-07-26  4:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67014

            Bug ID: 67014
           Summary: builtin_tolower is inefficient.
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: neleai at seznam dot cz
  Target Milestone: ---

Hi,

When one uses __builtin_tolower it could be much slower to tolower. In this
example builtin_tolower gets just expanded to call. If one uses tolower instead 
it gets expanded to getting table with __ctype_tolower_loc and then doing 1000
table lookups instead 1000 calls.

#include <ctype.h>
int foo(char *c)
{
 int i;
 for(i=0;i<1000;i++)
   c[i]=__builtin_tolower(c[i]);
}


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-18 12:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-26  4:53 [Bug middle-end/67014] New: builtin_tolower is inefficient neleai at seznam dot cz
2021-06-04 21:45 ` [Bug ipa/67014] " pinskia at gcc dot gnu.org
2021-06-10 15:17 ` marxin at gcc dot gnu.org
2021-08-18 12:40 ` marxin at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).