This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PR other/31852] Add __builtin_memchr


On 5/11/07, Paolo Carlini <pcarlini@suse.de> wrote:
Hi again,

everything considered, I would rather propose a very simple variant of
my first try - only adds a check on len - consistent with our current
memcmp. It's safe and we can always improve the optimization later on.
Tested x86_64-linux.

Ok this one for mainline?

Works for me. Btw, the check for INTEGER_CST is redundant with the host_integerp check (the function verifies that).

Richard.

Paolo.

////////////////

2007-05-11 Paolo Carlini <pcarlini@suse.de>

        PR other/31852
        * builtin-types.def: Add BT_FN_PTR_CONST_PTR_INT_SIZE.
        * builtins.def: Add BUILT_IN_MEMCHR, use the latter.
        * builtins.c (fold_builtin_memchr): New.
        (expand_builtin_memchr): Call the latter.
        (expand_builtin, fold_builtin_3): Deal with BUILT_IN_MEMCHR.
        * doc/extend.texi ([Other built-in functions provided by GCC]):
        Document memchr.

/testsuite
2007-05-11  Paolo Carlini  <pcarlini@suse.de>

        PR other/31852
        * gcc.c-torture/execute/builtins/memchr.c: New.
        * gcc.c-torture/execute/builtins/memchr-lib.c: New.
        * gcc.c-torture/execute/builtins/lib/memchr.c: New.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]