This is the mail archive of the mailing list for the glibc 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 v2] Remove defines to builtins in string2.h

Joseph Myers wrote:

> Unless you also change all calls to __stpcpy to call stpcpy directly, you 
> are potentially losing built-in function optimizations by removing the 
> __stpcpy macro.  glibc contains calls to __stpcpy as well as direct ones 
> to stpcpy.  Because of the other redirections, it's safe to change 
> __stpcpy calls to stpcpy calls in glibc as a preparatory patch.  Likewise 
> __mempcpy.

Right, it does seem there are a few cases where __stpcpy may be optimized.
So for this patch I'll keep the #define __stpcpy until existing calls to __stpcpy
have been changed.

> I think you need to separate the case of
> #define foo(x) __builtin_foo (x)
> from all the other cases, where a more complicated macro expansion is 
> involved (in which case we need to see if GCC has relevant optimizations 
> or have a reason why they are appropriate to discard), or where the macro 
> is __foo instead of foo.

This patch doesn't remove any optimizations - as I mentioned in the description,
the strncat macro is unused as _USE_STRING_ARCH_strchr is always false
(and in the next version I'm removing that define as well).

> Also, patches like this are the sort where it would be useful to make sure 
> that installed stripped shared libraries and executables are unchanged by 
> the patch, or to have a reason why it results in any changes to the 
> generated code.

Yes my goal was no diff, and that's true for the new version that also removes
all unused string defines.


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