linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Christoph Lameter <cl@linux-foundation.org>
Cc: Andi Kleen <andi@firstfloor.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, Mike Travis <travis@sgi.com>,
	Ingo Molnar <mingo@elte.hu>, Richard Henderson <rth@twiddle.net>,
	akpm@osdl.org
Subject: Re: linux-next: manual merge of the rr tree
Date: Thu, 8 Jan 2009 21:48:35 +0100	[thread overview]
Message-ID: <20090108204835.GI496@one.firstfloor.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0901071300430.8329@quilx.com>

On Wed, Jan 07, 2009 at 01:01:06PM -0600, Christoph Lameter wrote:
> On Wed, 7 Jan 2009, Andi Kleen wrote:
> 
> > The C standard says that arithmetic on pointers in defined objects outside
> > the boundaries of these objects (except for the special case of one beyond
> > the end for arrays) is undefined. The gcc optimizers take advantage
> > of this by assuming that such arithmetic doesn't wrap (and might have other
> > assumptions)
> 
> Ok then we need to say so in a comment around RELOC_HIDE.

Here's a patch to do that. Andrew, please add it.

-Andi

---


Add more comments to RELOC_HIDE

Requested by C. Lameter

Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 include/linux/compiler-gcc.h |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

Index: linux-2.6.28-test/include/linux/compiler-gcc.h
===================================================================
--- linux-2.6.28-test.orig/include/linux/compiler-gcc.h	2008-05-08 12:56:10.000000000 +0200
+++ linux-2.6.28-test/include/linux/compiler-gcc.h	2009-01-08 21:31:55.000000000 +0100
@@ -11,9 +11,19 @@
 /* The "volatile" is due to gcc bugs */
 #define barrier() __asm__ __volatile__("": : :"memory")
 
-/* This macro obfuscates arithmetic on a variable address so that gcc
-   shouldn't recognize the original var, and make assumptions about it */
-/*
+/*
+ * This macro obfuscates arithmetic on a variable address so that gcc
+ * shouldn't recognize the original var, and make assumptions about it.
+ *
+ * This is needed because the C standard makes it undefined to do
+ * pointer arithmetic on "objects" outside their boundaries and the
+ * gcc optimizers assume this is the case. In particular they
+ * assume such arithmetic does not wrap.
+ *
+ * A miscompilation has been observed because of this on PPC.
+ * To work around it we hide the relationship of the pointer and the object
+ * using this macro.
+ *
  * Versions of the ppc64 compiler before 4.1 had a bug where use of
  * RELOC_HIDE could trash r30. The bug can be worked around by changing
  * the inline assembly constraint from =g to =r, in this particular

-- 
ak@linux.intel.com

  reply	other threads:[~2009-01-08 20:34 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-05  3:32 linux-next: manual merge of the rr tree Stephen Rothwell
2009-01-05  6:57 ` Rusty Russell
2009-01-05 12:47   ` Ingo Molnar
2009-01-06  8:51     ` Rusty Russell
2009-01-06  9:20       ` Ingo Molnar
2009-01-06 13:13       ` Mike Travis
2009-01-06 13:19         ` Ingo Molnar
2009-01-06 14:21           ` Mike Travis
2009-01-06 14:59             ` Ingo Molnar
2009-01-07  2:46             ` Rusty Russell
2009-01-05 15:29   ` Christoph Lameter
2009-01-06  1:04     ` Rusty Russell
2009-01-06 15:05       ` Christoph Lameter
2009-01-07  2:47         ` Rusty Russell
2009-01-07 16:11           ` Christoph Lameter
2009-01-07 17:20             ` Andi Kleen
2009-01-07 19:01               ` Christoph Lameter
2009-01-08 20:48                 ` Andi Kleen [this message]
2009-01-08 20:50                   ` Andrew Morton
2009-01-08 21:15                   ` Christoph Lameter
2009-01-08 21:49                     ` Andi Kleen
2009-01-08 22:21                       ` Christoph Lameter
2009-01-08 22:25                         ` David Miller
2009-01-09 14:42                           ` Christoph Lameter
2009-01-09 22:54                             ` David Miller
2009-01-05 19:46   ` Mike Travis
2009-01-05  8:41 ` Rusty Russell
2009-01-06  3:46   ` Stephen Rothwell
2009-01-06 13:26     ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2009-01-09  1:53 Stephen Rothwell
2009-01-06  3:11 Stephen Rothwell
2008-12-29  7:51 Stephen Rothwell
2008-12-29  7:47 Stephen Rothwell
2008-12-29  8:02 ` Stephen Rothwell
2008-12-22  6:32 Stephen Rothwell
2008-12-22  7:58 ` Rusty Russell
2008-12-22  8:45   ` Mark McLoughlin
2009-01-04 23:30 ` Stephen Rothwell
2009-01-05  4:36   ` Greg KH
2009-01-05  5:56     ` Stephen Rothwell
2008-12-16  5:29 Stephen Rothwell
2008-12-15  6:15 Stephen Rothwell
2008-11-24  3:20 Stephen Rothwell
2008-11-20  3:24 Stephen Rothwell
2008-11-20  4:28 ` Rusty Russell
2008-11-14  4:13 Stephen Rothwell
2008-11-14  4:20 ` Stephen Rothwell
2008-11-14  4:30   ` David Miller
2008-11-14  4:36     ` Stephen Rothwell
2008-11-14  4:41       ` David Miller
2008-11-14  5:06         ` Stephen Rothwell
2008-11-14  6:42           ` David Miller
2008-11-15 22:32             ` Rusty Russell
2008-11-17  2:57               ` David Miller
2008-11-07  5:01 Stephen Rothwell
2008-10-29  4:28 Stephen Rothwell
2008-10-29  4:33 ` Stephen Rothwell
2008-10-29 22:42 ` Rusty Russell
2008-10-28  2:55 Stephen Rothwell
2008-10-28  7:19 ` Heiko Carstens
2008-10-28  7:24   ` Stephen Rothwell
2008-10-27  3:32 Stephen Rothwell
2008-10-24  2:21 Stephen Rothwell
2008-10-23  4:12 Stephen Rothwell
2008-10-23  5:16 ` Rusty Russell
2008-10-23 12:26   ` Rusty Russell
2008-10-23 12:50   ` Mike Travis
2008-10-23  4:01 Stephen Rothwell
2008-10-23  7:17 ` Peter Zijlstra
2008-10-23 13:32 ` Rusty Russell
2008-10-23  3:56 Stephen Rothwell
2008-10-23 12:25 ` Rusty Russell
2008-09-12 21:53 Stephen Rothwell
2008-07-28  3:16 Stephen Rothwell
2008-07-28  3:13 Stephen Rothwell
2008-07-28  3:09 Stephen Rothwell
2008-07-22  4:58 Stephen Rothwell
2008-07-22 14:21 ` Mike Travis
2008-07-16  8:15 Stephen Rothwell
2008-07-17  5:46 ` Max Krasnyansky
2008-07-18  4:31   ` Rusty Russell
2008-07-14  6:52 Stephen Rothwell
2008-07-03  5:03 Stephen Rothwell
2008-07-03  5:56 ` Ingo Molnar
2008-07-03  8:07   ` Stephen Rothwell
2008-07-03  8:19     ` Ingo Molnar
2008-07-04  0:45       ` Rusty Russell
2008-07-04  0:29   ` Rusty Russell
2008-06-25  6:27 Stephen Rothwell
2008-06-25  6:38 ` Christian Borntraeger
2008-06-25 15:23   ` Stephen Rothwell
2008-06-25  6:27 Stephen Rothwell
2008-06-25  7:47 ` Ingo Molnar
2008-06-25  8:33   ` Rusty Russell

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=20090108204835.GI496@one.firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=akpm@osdl.org \
    --cc=cl@linux-foundation.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rth@twiddle.net \
    --cc=rusty@rustcorp.com.au \
    --cc=sfr@canb.auug.org.au \
    --cc=travis@sgi.com \
    /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).