This is the mail archive of the libc-alpha@sourceware.org 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: GCC 4.8 and -ftree-loop-distribute-patterns.


On 09/04/13 00:03, Adhemerval Zanella wrote:
> On 04/08/2013 10:26 AM, Carlos O'Donell wrote:
>> On 04/08/2013 07:41 AM, Adhemerval Zanella wrote:
>>> On 04/06/2013 11:01 AM, Carlos O'Donell wrote:
>>>> The patch, like my Fedora patch, is incomplete. We need to detect
>>>> the compiler feature, set a feature macro, and then conditionally
>>>> carry out whatever is required to allow glibc to compile with the
>>>> feature enabled.
>>>>
>>>> In your case it would be to include string.h.
>>>>
>>>> I'm up to my ears in other work, so I would be more than happy to
>>>> give up the glory that goes along with fixing this :-)
>>> I'm not a big fan of adding logic to handle a compiler feature to
>>> just add or a not an include, however it is up to discussion. I'll
>>> work on this fix.
>> It's more than that, it's about long-term maintenance of that hack.
>> The goal is to get everyone into the habit of checking for features
>> instead of GCC versions. That way the maintenance burden is *much*
>> easier 5, 10 years down the road. The macros all use features and
>> features have strict meanings. There is no such thing as GCC 4.8,
>> there are 4.8's for all the distros with lots of patches. We should
>> always check for a feature, enable the macro, and adjust using the
>> macro. That way reviewing code and headers and conditionals becomes
>> much easier and almost self-documenting.
>>
>> Does that make sense?
> 
> Yes, I was considering more the fact it would be more simple to just add
> the includes, but your points make sense.
> 
> I believe the patch below check pretty much what you said. I tested on
> PowerPC64 and I don't see the check-localplt failures for libc.so anymore.
> Any tips, comments, advices?
> 
> --
> 
> 2013-04-08  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
> 
> 	* config.h.in: Add HAVE_CC_PREDEF_DISTRIBUTE_PATTERNS define.
> 	* configure.in (libc_cv_predef_loop_distribute_patttern): Check if
> 	compiler with defined optimization may generate memset/memmove
> 	library calls for some loop constructions.
> 	* configure: Regenerate.
> 	* stdlib/divrem.c: Include <string.h> if
> 	HAVE_CC_PREDEF_DISTRIBUTE_PATTERNS is defined.
> 	* stdlib/mul.c: Likewise.
> 	* stdlib/mul_n.c: Likewise.
> 	* wcsmbs/wcpncpy.c: Likewise.
> 	* wcsmbs/wcsncpy.c: Likewise.
> 
> ---
> 
> diff --git a/config.h.in b/config.h.in
> index 8c2479e..f598e82 100644
> --- a/config.h.in
> +++ b/config.h.in
> @@ -69,6 +69,9 @@
>  /* Define if the compiler supports __builtin_memset.  */
>  #undef	HAVE_BUILTIN_MEMSET
>  
> +/* Define if compiler implicitly defines -ftree-loop-distribute-patterns.  */
> +#undef  HAVE_CC_PREDEF_DISTRIBUTE_PATTERNS
> +
>  /* Define if the regparm attribute shall be used for local functions
>     (gcc on ix86 only).  */
>  #undef	USE_REGPARMS
> diff --git a/configure b/configure
> index 0b50df9..8b83a9c 100755
> --- a/configure
> +++ b/configure
> @@ -598,6 +598,7 @@ have_selinux
>  have_libcap
>  have_libaudit
>  LIBGD
> +libc_cv_predef_loop_distribute_pattterns

typo - pattterns   (and throughout)



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