Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1396524

Re: [PATCH] compiler-gcc: require gcc 4.8 for powerpc __builtin_bswap16()

From Stephen Rothwell <sfr@canb.auug.org.au>
Newsgroups linux.kernel
Subject Re: [PATCH] compiler-gcc: require gcc 4.8 for powerpc __builtin_bswap16()
Date 2016-05-09 03:00 +0200
Message-ID <rwHIe-189-5@gated-at.bofh.it> (permalink)
References <rvG1Q-6VA-3@gated-at.bofh.it> <rvGOd-7Es-1@gated-at.bofh.it> <rvH7D-8cC-113@gated-at.bofh.it> <rvHTY-fK-3@gated-at.bofh.it> <rvOVr-6Tb-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Josh,

On Fri, 6 May 2016 09:22:25 -0500 Josh Poimboeuf <jpoimboe@redhat.com> wrote:
>
> I've also seen no problems on powerpc with 4.4 and 4.8.  I suspect it's
> specific to gcc 4.6.  Stephen, can you confirm this patch fixes it?

That will obviously fix the problem for us (since it will effectively
restore the code to what it was before the other commit for our gcc
4.6.3 builds and we have not seen it in other builds).  I will add this
patch to linux-next today.

And since "byteswap: try to avoid __builtin_constant_p gcc bug" is not
in Linus' tree, hopefully we can have this fix applied soon.

> From: Josh Poimboeuf <jpoimboe@redhat.com>
> Subject: [PATCH] compiler-gcc: require gcc 4.8 for powerpc __builtin_bswap16()
> 
> gcc support for __builtin_bswap16() was supposedly added for powerpc in
> gcc 4.6, and was then later added for other architectures in gcc 4.8.
> 
> However, Stephen Rothwell reported that attempting to use it on powerpc
> in gcc 4.6 fails with:
> 
>   lib/vsprintf.c:160:2: error: initializer element is not constant
>   lib/vsprintf.c:160:2: error: (near initialization for 'decpair[0]')
>   lib/vsprintf.c:160:2: error: initializer element is not constant
>   lib/vsprintf.c:160:2: error: (near initialization for 'decpair[1]')
>   lib/vsprintf.c:160:2: error: initializer element is not constant
>   lib/vsprintf.c:160:2: error: (near initialization for 'decpair[2]')
>   lib/vsprintf.c:160:2: error: initializer element is not constant
>   lib/vsprintf.c:160:2: error: (near initialization for 'decpair[3]')
>   lib/vsprintf.c:160:2: error: initializer element is not constant
> 
> I'm not entirely sure what those errors mean, but I don't see them on
> gcc 4.8.  So let's consider gcc 4.8 to be the official starting point
> for __builtin_bswap16().
> 
> Fixes: 7322dd755e7d ("byteswap: try to avoid __builtin_constant_p gcc bug")
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
> ---
>  include/linux/compiler-gcc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> index eeae401..3d5202e 100644
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -246,7 +246,7 @@
>  #define __HAVE_BUILTIN_BSWAP32__
>  #define __HAVE_BUILTIN_BSWAP64__
>  #endif
> -#if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600)
> +#if GCC_VERSION >= 40800
>  #define __HAVE_BUILTIN_BSWAP16__
>  #endif
>  #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
> -- 
> 2.4.11

-- 
Cheers,
Stephen Rothwell

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

linux-next: build failure after merge of the akpm-current tree Stephen Rothwell <sfr@canb.auug.org.au> - 2016-05-06 07:00 +0200
  Re: linux-next: build failure after merge of the akpm-current tree Andrew Morton <akpm@linux-foundation.org> - 2016-05-06 07:50 +0200
    Re: linux-next: build failure after merge of the akpm-current tree Stephen Rothwell <sfr@canb.auug.org.au> - 2016-05-06 08:10 +0200
      Re: linux-next: build failure after merge of the akpm-current tree Michael Ellerman <mpe@ellerman.id.au> - 2016-05-06 09:00 +0200
        [PATCH] compiler-gcc: require gcc 4.8 for powerpc __builtin_bswap16() Josh Poimboeuf <jpoimboe@redhat.com> - 2016-05-06 16:30 +0200
          Re: [PATCH] compiler-gcc: require gcc 4.8 for powerpc  __builtin_bswap16() Stephen Rothwell <sfr@canb.auug.org.au> - 2016-05-09 03:00 +0200
            Re: [PATCH] compiler-gcc: require gcc 4.8 for powerpc __builtin_bswap16() Sedat Dilek <sedat.dilek@gmail.com> - 2016-05-09 07:40 +0200
              Re: [PATCH] compiler-gcc: require gcc 4.8 for powerpc  __builtin_bswap16() Stephen Rothwell <sfr@canb.auug.org.au> - 2016-05-09 10:40 +0200
            Re: [PATCH] compiler-gcc: require gcc 4.8 for powerpc  __builtin_bswap16() Stephen Rothwell <sfr@canb.auug.org.au> - 2016-05-09 08:40 +0200
              Re: [PATCH] compiler-gcc: require gcc 4.8 for powerpc  __builtin_bswap16() Michael Ellerman <mpe@ellerman.id.au> - 2016-05-09 11:40 +0200
                Re: [PATCH] compiler-gcc: require gcc 4.8 for powerpc __builtin_bswap16() Arnd Bergmann <arnd@arndb.de> - 2016-05-09 12:20 +0200
                [PATCH] compiler-gcc: require gcc 4.8 for powerpc  __builtin_bswap16() Stephen Rothwell <sfr@canb.auug.org.au> - 2016-05-09 12:40 +0200

csiph-web