https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60947
--- Comment #16 from Mikael Pettersson <mikpelinux at gmail dot com> --- (In reply to amker from comment #15) > Well, only thing suspicious that I can see, the memset function is a special > implementation and not from C standard library. Basically it doesn't need > to follow the standard, which means the return value could be something else > other than the passed in pointer. Though I doubt it would actually break > the standard. > > So YuFan, could you help look into implementation of memset to see if it > acts as expected? > > Thanks. I recall seeing reports of the Linux/ARM kernel being miscompiled by gcc-4.8 (or so) a while ago, and it was traced to an in-kernel memset() (or related mem/str-function) implementation not following the same return value convention as the normal user-space version. The problem is that newer gcc:s optimize some mem/str-functions based on those return value conventions, so things broke. The 2.6.28 kernel is ancient, so it's not at all surprising it won't work when compiled by non-ancient gcc:s.