On Sat, Jan 05, 2019 at 01:17:21PM +0000, Bernd Edlinger wrote: > Well, yes it works, but this can only optimize invalid code like > strlen((char*)L"wide").
There is nothing invalid on it. Furthermore, the strlen pass doesn't optimize just strlen, it does many optimizations that rely on knowing how many non-zero bytes there are and if followed by zero byte. Initialization from a multi-byte string literal is just an initialization like any other, from array of ints, or characters, whatever. Jakub