Bernhard Reutner-Fischer wrote:
>If i'm not mistaken, the s++ is fully redundant here although it seems
>that my gcc-11 does not optimize it like if we manually spell it out
>like in the attached?

I don't think it's possible to avoid two increments.  When a backslash
is detected we want to move past it and the following character.

Consider:

   strchr_backslash("\\/abc/def", '/');

The original code and Denys' rewrite return a pointer to "/def"; your
suggestion returns a pointer to "/abc/def".

>Must be marked noinline to avoid inlining it twice it seems?!
>If that double inlining really happens then the implied code growth
>even for -Os is a different bug..

Hmm, yes, that's rather an odd thing for the compiler to do.

Ron
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to