Re: linux/mm.h breaks memset()

David Mosberger-Tang (davidm@AZStarNet.com)
Wed, 18 Oct 1995 18:03:45 -0700


>>>>> On Wed, 18 Oct 1995 18:34:27 -0400, "David S. Miller" <davem@caip.rutgers.edu> said:

ewt> [compiling without -O results in undefined reference to
ewt> __constant_c_memset]

David> Does turning on '-O2' make the problem go away? Gcc looks
David> like it isn't inlining the functions the linker is
David> complaining about, and the gcc docs explicitly state that
David> inlining isn't guarenteed to occur with optimizations off.

Correct, but I still think it's a bug. IMHO, it is OK to require -O
for kernel compiles, but it should be possible to compile user-level
programs without -O.

Also, I'm not convinced that the __constant_c_memset is such a great
idea---it results in a 64-bit constant being loaded from memory, which
is potentially much slower on a cache-miss than the few instructions
that it takes to replicate the byte eight times (except for the
important special case where the constant is zero, of course).

--david