[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200608250818.49139.ak@suse.de>
Date: Fri, 25 Aug 2006 08:18:49 +0200
From: Andi Kleen <ak@...e.de>
To: "Dong Feng" <middle.fengdong@...il.com>
Cc: "Paul Mackerras" <paulus@...ba.org>,
"Christoph Lameter" <clameter@....com>,
linux-kernel@...r.kernel.org
Subject: Re: Unnecessary Relocation Hiding?
On Friday 25 August 2006 03:30, Dong Feng wrote:
> Sorry for perhaps extending the specific question to a more generic
> one. In which cases shall we, in current or future development,
> prevent gcc from knowing a pointer-addition in the way RELOC_HIDE? And
> in what cases shall we just write pure C point addition?
>
> After all, we are writing an OS in C not in pure assembly, so I am
> just trying to learn some generial rules to mimize the raw assembly in
> development.
In theory anything that is undefined in the C standard should be avoided
because gcc is free to make assumptions about it and generate unexpected
code.
In practice Linux does a lot of not-quite-legal-in-portable-C things
already, but tries to avoid areas that are known to have miscompiled in
the past.
Best is to avoid undefined behaviour in new code.
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists