linux-alpha.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Cree <mcree@orcon.net.nz>
To: linux-alpha@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, rth@twiddle.net,
	ink@jurassic.park.msu.ru, David Howells <dhowells@redhat.com>
Subject: Alpha: suspicious compiler warning in entry.S
Date: Wed, 28 Oct 2009 20:03:30 +1300	[thread overview]
Message-ID: <4AE7ECC2.8050202@orcon.net.nz> (raw)

Compiler warning when compiling 2.6.32-rc5 as follows:

  AS      arch/alpha/kernel/entry.o
arch/alpha/kernel/entry.S: Assembler messages:
arch/alpha/kernel/entry.S:326: Warning: operand out of range 
(0x0000000000000406 is not between 0x0000000000000000 and 
0x00000000000000ff)
arch/alpha/kernel/entry.S:388: Warning: operand out of range 
(0x0000000000000406 is not between 0x0000000000000000 and 
0x00000000000000ff)

One offending line (326) is:

    and    $5, _TIF_WORK_MASK, $2

The warning occurs because commit d0420c83f39f "KEYS: Extend
TIF_NOTIFY_RESUME to (almost) all architectures [try #6]" introduces
TIF_NOTIFIY_RESUME which sets bit 10 in _TIF_WORK_MASK (see
arch/alpha/include/asm/thread_info.h) but _TIF_WORK_MASK is used in the
immediate addressing mode in the assembler instruction above. The 'and'
instruction can only take an immediate datum in the range 0 to 255.  With
the addition of the TIF_NOTIFY_RESUME bit, _TIF_WORK_MASK is no longer in
the valid range for immediate addressing in the 'and' instruction.

On the assumption that it is important to include the TIF_NOTIFY_RESUME bit
one might be tempted to modify the code to:

    lda    $2, _TIF_WORK_MASK
    and    $5, $2, $2

but this is time critical code.  I am wondering whether it might be better
to rearrange the bits in the thread information flags so that _TIF_WORK_MASK
has a value less than 255 and the single instruction to perform an and
operation can be maintained.

Comments?

Cheers
Michael.


             reply	other threads:[~2009-10-28  7:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-28  7:03 Michael Cree [this message]
2009-10-28 23:13 ` Alpha: suspicious compiler warning in entry.S Richard Henderson
2009-10-31  2:33   ` [PATCH] Alpha: Rearrange thread info flags fixing two regressions Michael Cree
2009-12-01  4:06     ` Matt Turner
2009-12-01 12:31       ` Christoph Hellwig
2009-12-01 15:58         ` Matt Turner
2009-10-30 13:16 ` Alpha: suspicious compiler warning in entry.S David Howells

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=4AE7ECC2.8050202@orcon.net.nz \
    --to=mcree@orcon.net.nz \
    --cc=dhowells@redhat.com \
    --cc=ink@jurassic.park.msu.ru \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rth@twiddle.net \
    /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;
as well as URLs for NNTP newsgroup(s).