From: Wolfgang Denk Date: Tue, 11 Feb 2014 19:18:03 +0100 Subject: [U-Boot] [PATCH v2] arm: Switch to -mno-unaligned-access when supported by the compiler In-Reply-To: References: <1391533533-21664-1-git-send-email-trini@ti.com> <20140210102447.03a4007f@lilith> <20140210132139.GT7049@bill-the-cat> <20140210155751.23849fcb@lilith> <20140210171224.477e2906@lilith> <20140210162403.GV7049@bill-the-cat> <20140210182646.2de92810@lilith> <20140210212630.GB7049@bill-the-cat> <20140210221723.B3DFB380603@gemini.denx.de> <20140210222819.GE7049@bill-the-cat> <20140211081909.BAAED380314@gemini.denx.de> <20140211144349.CBF9938032B@gemini.denx.de> Message-ID: <20140211181803.2F3ED380BED@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear M?ns Rullg?rd, In message you wrote: > > > With application code you don't really care whether a variable is > > read/written in one piece or broken down into several smaller > > reads/writes - except when you notice that performance suffers. > > > > When accessing hardware, it often makes a fundamental difference > > whether you access a device register with it's correct size or not. > > Usually breaking down an access into smaller ones results in crashes > > or incorrect data or other errors. > > I'm well aware of this, but it has nothing to do with the issue at hand. This is by your definition, or based on which exact rationale? > Device registers are always aligned. In properly written code these are > accessed using pointers the compiler knows to be aligned and thus does > the right thing. Maybe the device registers you have seen so far have always been perfectly aligned. Lucky you. Note that there are a number of designs around (that I do not hesitate to call broken) which have such properties. And when we include external hardware into the discussion like PCI attached devices or customer-designed FPGAs, it becomes even more "interesting". I think we can stop the discussion here (at least I will do that now). I haven't seen any new arguments coming up. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The trouble with our times is that the future is not what it used to be. - Paul Valery