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]

Re: Patch for builtin strpbrk


>>>>> "Kaveh" == Kaveh R Ghazi <ghazi@caip.rutgers.edu> writes:

    Kaveh> The following patch adds a builtin strpbrk which behaves as
    Kaveh> listed in: http://gcc.gnu.org/projects/.

    Kaveh> It transforms the cases where the second argument is a
    Kaveh> constant string, either "" or "c" where `c' is any one
    Kaveh> character.  I.e.:

    >> strpbrk(foo, "") -> NULL strpbrk(foo, "c") -> strchr(foo, c)

    Kaveh> Bootstrap and testsuite underway.  Assuming no regressions,
    Kaveh> okay to install?

Yes.

You might as well also do the case where both operands are constants;
that can always be computed at compile-time...

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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