This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR 10339: New TARGET_UNSAFE_MEMCMP macro


On Wednesday, April 16, 2003, at 12:05 PM, Richard Henderson wrote:

On Tue, Apr 15, 2003 at 09:07:35PM -0600, Roger Sayle wrote:
	* defaults.h (TARGET_UNSAFE_MEMCMP): Default target macro to zero.
	* builtins.c (expand_builtin_strncmp): Don't optimize strncmp
	into memcmp if TARGET_UNSAFE_MEMCMP is non-zero.
	* doc/tm.texi: Document the new TARGET_UNSAFE_MEMCMP target macro.

I'm not really in favour of this. I'd prefer we simply honor the spec as written.

I sympathize, but after all this is a useful and safe optimization in every known environment. Suppose Roger reversed the default, so that UNSAFE_MEMCMP is the default, and any target where it actually is safe has to enable that explicitly. Would that work for you?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]