http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61056

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
1) your testcase uses strrchr rather than strchr
2) why do you think it is desirable to convert strchr (x, 0) to x + strlen (x)?
Unless you have good library implementation for the latter and bad for the
former, strchr (x, 0) should be a win.
What the strlen pass does is that if you e.g. use strchr (x, 0) or strlen (x)
several times when the lengths of the strings actually can't change in between,
it can avoid the second and following call.  And, it is able to deal even with
strlen (x) used in one place and strchr (x, 0) in another or vice versa etc.
(plus various other optimizations).

Reply via email to