[Bug tree-optimization/61056] strchr (x, 0) is not converted to strlen (x)

2016-11-02 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61056

wilco at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||wilco at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #6 from wilco at gcc dot gnu.org ---
Fixed in r240568.

[Bug tree-optimization/61056] strchr (x, 0) is not converted to strlen (x)

2016-09-29 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61056

--- Comment #5 from Oleg Endo  ---
https://gcc.gnu.org/viewcvs/gcc?view=revision=240568

[Bug tree-optimization/61056] strchr (x, 0) is not converted to strlen (x)

2016-09-06 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61056

--- Comment #4 from Andrew Pinski  ---
See bug 32650 also.

[Bug tree-optimization/61056] strchr (x, 0) is not converted to strlen (x)

2016-09-06 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61056

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization
   Severity|normal  |enhancement

[Bug tree-optimization/61056] strchr (x, 0) is not converted to strlen (x)

2016-04-19 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61056

--- Comment #3 from Oleg Endo  ---
Just for reference
https://gcc.gnu.org/ml/gcc-patches/2016-04/msg00870.html

[Bug tree-optimization/61056] strchr (x, 0) is not converted to strlen (x)

2014-05-04 Thread jakub at gcc dot gnu.org
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).


[Bug tree-optimization/61056] strchr (x, 0) is not converted to strlen (x)

2014-05-04 Thread olegendo at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61056

--- Comment #2 from Oleg Endo olegendo at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #1)
 1) your testcase uses strrchr rather than strchr

Sorry, typo/pasto.  It was meant to be strchr.

 2) why do you think it is desirable to convert strchr (x, 0) to x + strlen
 (x)?

On SH we have a builtin strlen implementation.  I was just expecting strchr (x,
0) to utilize it, that's all.

 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).

Ah, thanks for the explanation.
BTW, are there any plans to add true builtin strchr support so that it can be
expanded by the target code in the same way as strlen?