From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernd Petrovitsch Date: Thu, 02 Feb 2012 09:28:42 +0000 Subject: RE: Memory corruption due to word sharing Message-Id: <1328174924.12177.17.camel@thorin> List-Id: References: <20120201151918.GC16714@quack.suse.cz> <1328118174.15992.6206.camel@triegel.csb> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "Boehm, Hans" Cc: Linus Torvalds , Torvald Riegel , Jan Kara , LKML , "linux-ia64@vger.kernel.org" , "dsterba@suse.cz" , "ptesarik@suse.cz" , "rguenther@suse.de" , "gcc@gcc.gnu.org" On Mit, 2012-02-01 at 21:04 +0000, Boehm, Hans wrote: [...] > The C11 memory model potentially adds overhead in only two cases: > > 1. When current code involves touching a field that wouldn't otherwise > be touched. There are odd cases in which this measurably slows down > code, but I think all agree that we need it. In addition to > bitfields, it can affect speculatively promoting a value to a register > in a loop, which at least older versions of gcc also do. Just adding an -f option for this and/or activating it only for -O5 (or whatever the highest level is) and - in case that feature is activated - emit warnings if bitfields (and/or any other data types that might be affected)? Kind regards, Bernd -- Bernd Petrovitsch Email : bernd@petrovitsch.priv.at LUGA : http://www.luga.at