[PATCH] [RFC] arm: fix memset-related crashes caused by recent GCC (4.7.2) optimizations

Will Deacon will.deacon at arm.com
Mon Feb 11 13:41:14 EST 2013


On Sat, Feb 02, 2013 at 08:33:08AM +0000, Ivan Djelic wrote:
> Recent GCC versions (e.g. GCC-4.7.2) perform optimizations based on
> assumptions about the implementation of memset and similar functions.
> The current ARM optimized memset code does not return the value of
> its first argument, as is usually expected from standard implementations.

How does GCC do this? By strcmping the function name and assuming that
memset is a libc implementation?

If so, maybe passing something like -ffreestanding would make sense to turn
this behaviour off in the compiler (otherwise we should also vet the rest of
the standard string functions).

Will



More information about the linux-arm-kernel mailing list