how is strcmp implemented so efficiently?

me22 me22.ca@gmail.com
Tue Sep 30 22:55:00 GMT 2008


On Tue, Sep 30, 2008 at 18:40, Reza Roboubi <reza@parvan.net> wrote:
> I noticed that strcmp is extremely smart.  It knows when one parameter has
> constant length, determined at compile time.  In that case it reverts to an
> inline version of the x86 string commands.
>

Sounds like one of the optimizer passes has special-case code to handle it.



More information about the Gcc-help mailing list