http://goo.gl/oNbp0y (the gcc baseline) recognizes an always failing memchr and returns 0 immediately. http://goo.gl/9ulXBx with essentially the same source code still calls memchr.
http://goo.gl/U3tuew @Iain should we simply add an alias in core.stdc.string?
This only occurs in gdc-4.6 - which is at least 2 years old, and doesn't have the optimisation I wrote which allows the compiler to detect gcc builtins in core.stdc - which were introduced just over a year ago. http://goo.gl/462PBi
Right, I somehow missed that. d.godbolt.org also supports a recent gdc 4.8.2 release btw: http://goo.gl/0oYgOs