Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754306AbbFOLaV (ORCPT ); Mon, 15 Jun 2015 07:30:21 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44601 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752642AbbFOLaN (ORCPT ); Mon, 15 Jun 2015 07:30:13 -0400 Date: Mon, 15 Jun 2015 13:30:11 +0200 (CEST) From: Michael Matz To: Borislav Petkov cc: Enrico Mioso , linux-kernel@vger.kernel.org, x86-ml Subject: Re: X86 GIT GCC 5 compilation warning In-Reply-To: <20150614180724.GB14892@pd.tnic> Message-ID: References: <20150614180724.GB14892@pd.tnic> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1624 Lines: 43 Hi, On Sun, 14 Jun 2015, Borislav Petkov wrote: > > arch/x86/kernel/head_32.S:66: Warning: shift count out of range (32 is not between 0 and 31) > > That's > > LOWMEM_PAGES = (((1<<32) - __PAGE_OFFSET) >> PAGE_SHIFT) > > and a 32-bit build. So gas hasn't been complaning so far about this. This warning is in gas since 2009 (commit d85733c8). In this case it only happens when the internal type to represent values is 32 bit, which happens only when binutils is compiled for only non-64bit architectures, _on_ a non-64bit architecture (e.g. when it's compiled on i386 for i386). This has nothing to do with GCC, but must be a change in his binutils. > Judging by the warning, it seems gas considers the "1" a 4-byte type now > and complains about the shift overflow. gas internally converts all values to a common type valueT (or offsetT), which is either a 64bit type if necessary for the target, or simply (unsigned) long. So if compiled on a 32bit arch, for only 32bit targets it will be a 32bit type, and the warning will trigger. E.g. on a gas compiled with gcc -m32 and for i386-unknown-linux-gnu: % gas/as-new bla.s bla.s: Assembler messages: bla.s:3: Warning: shift count out of range (32 is not between 0 and 31) (This doesn't happen when the gas is compiled on e.g. x86-64-linux or for a 64bit target, or with --enable-64-bit-bfd) Ciao, Michael. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/