mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Matz <matz@suse.de>
To: Borislav Petkov <bp@alien8.de>
Cc: Enrico Mioso <mrkiko.rs@gmail.com>,
	linux-kernel@vger.kernel.org, x86-ml <x86@kernel.org>
Subject: Re: X86 GIT GCC 5 compilation warning
Date: Mon, 15 Jun 2015 13:30:11 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LSU.2.20.1506151254340.27315@wotan.suse.de> (raw)
In-Reply-To: <20150614180724.GB14892@pd.tnic>

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.

  reply	other threads:[~2015-06-15 11:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-14 15:14 Enrico Mioso
2015-06-14 18:07 ` Borislav Petkov
2015-06-15 11:30   ` Michael Matz [this message]
2015-06-15 17:17     ` Borislav Petkov
2015-06-16 11:59       ` Michael Matz
2015-06-16 12:39         ` Enrico Mioso
2015-06-16 12:47           ` Michael Matz
2015-06-16 13:58             ` Borislav Petkov
2015-06-16 14:09               ` Enrico Mioso
2015-06-16 14:42               ` Enrico Mioso
2015-06-16 15:32                 ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LSU.2.20.1506151254340.27315@wotan.suse.de \
    --to=matz@suse.de \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mrkiko.rs@gmail.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®