News for hackers. Stuff that matters.
Re:Will It Optimize? by ridiculous_fish on Friday September 16, 2011 @03:58PM (#3006044)
Actually I think this is a glibc/BSD difference. You're right that any pure function would be hoisted in the same way, but in fact strlen() is not marked pure in my OS X header (which looks to be the same as in FreeBSD). Compiling with -fno-builtin defeats the optimization, which shows that it is due to strlen being built-in on those platforms.

On my Linux machine, on the other hand, strlen() is marked pure, and there the optimization persists even with -fno-builtin.

There are no comments on this comment yet.