This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR 10339: New TARGET_UNSAFE_MEMCMP macro
- From: Dale Johannesen <dalej at apple dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Dale Johannesen <dalej at apple dot com>, Roger Sayle <roger at www dot eyesopen dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 16 Apr 2003 12:22:19 -0700
- Subject: 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?