From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751605AbcEIKQ3 (ORCPT ); Mon, 9 May 2016 06:16:29 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:58770 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750927AbcEIKQ1 (ORCPT ); Mon, 9 May 2016 06:16:27 -0400 From: Arnd Bergmann To: Michael Ellerman Cc: Stephen Rothwell , Josh Poimboeuf , Andrew Morton , linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds Subject: Re: [PATCH] compiler-gcc: require gcc 4.8 for powerpc __builtin_bswap16() Date: Mon, 09 May 2016 12:16:11 +0200 Message-ID: <75773040.xkfFJb3GoQ@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1462786493.5531.1.camel@ellerman.id.au> References: <20160506145810.04a319d3@canb.auug.org.au> <20160509163302.59f3f6a2@canb.auug.org.au> <1462786493.5531.1.camel@ellerman.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:XTB/YkN4mjW0Kbj+QfNqsHtMNyKW5Vz1XVy0COPYiarnmbtCwwj dkUZq8pq09EJEThkxdLWJBN+nX85S0L+k8ZdTwP1BM39X5JovZcJduzc0OsylPHM9HWnA0a YsAem0FySbArPV3Z2HPAha+6ehw6/AwDrcXy/r8aPf1B/fqgzyWtCtmXLQDjIEmdZ994q+y KEMMK+RSf+eIGy+TVjvvw== X-UI-Out-Filterresults: notjunk:1;V01:K0:DNMSXPJKGho=:MgAHHkATerOkM4PJmWmLrX fg/Ibm9h6rkJnqM6ur0Y2nKX7/5DLD1aj1Ii1gK7lnlJhMM9omZxUTxHEpu9j/hTAiUhiW8Bz QFXFRYBt3jISj9hvkU4ATJvgHF0a8dhgljDE/oyP2B0v4HRq47GvhxaD2kZpt891j59PqI82s 4ftxbTMW02vXC9j+WsmrR79G2rB3lGmkb1+p9WB9ZumQFvi6QYaf/+sicUzsVDyzOKsjk6YyK EhTH9Mk4R/lPFqVKHoputRaj1OK8p5KXmamQ+UnJiRm/FbidBqTS/sI9hzeXUN2TBp94lvO+J w77BPlNJX+7FdG7vbNy1CVR7UvFZ7Cua3zHBCgjtlz2xcXaFjEFbIDlXNNV/eUFR56Dhl6/Aa 6VGDFR/sAJwlTO6aLwSCDGhM8OT1wpkkYly88063WuRt/gl/Tszo+kCiq75p0JDL1rkf/AReM E5iN41QF1x9pe7Xhhx0Z6UKV1CxkmllWggJS8r1AYvs0tOk41pZtwsjpB2i5rSaerZCRF3H99 IFyFTYavLSHPxb6uLeBqcvGbdXgkK8eo3BQQ9EA0HscA9lwMiGsEh6E8gldc4ROB0FcBcDMEg xzSTTDp9yURBLb194XK0ZqPFq+KwIYLmQgzoC/ZA4lexP6yFtn0qFmaWerj9PQn52GcL5Ldd3 LnifSnfk1GdpA1pxkZqoCq8QiR9qokIqmINUyGBqJ9XIeLBp2ccqT6qk8F1hcpSJnpLMotckc zn2nR3fFMeIbZOuy Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 09 May 2016 19:34:53 Michael Ellerman wrote: > On Mon, 2016-05-09 at 16:33 +1000, Stephen Rothwell wrote: > > On Mon, 9 May 2016 10:59:27 +1000 Stephen Rothwell wrote: > > > On Fri, 6 May 2016 09:22:25 -0500 Josh Poimboeuf wrote: > > > > 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 */ > > > > Tested-by: Stephen Rothwell Acked-by: Arnd Bergmann > > Michael, do you want to pass the fix patch on, or will I submit it > > directly to Linus? > > I'm happy for you to send it, I haven't actually hit the bug myself. I found the commit in gcc-4.8 that replaced the powerpc-specific implementation of __builtin_bswap16 with an architecture-independent one. Apparently the powerpc version (gcc-4.6 and 4.7) just mapped to the lhbrx/sthbrx instructions, so it ended up not being a constant, though the intent of the patch was mainly to add support for the builtin to x86. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52624 has the patch that went into gcc-4.8 and more information. Arnd