public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [RFA:] Caveat for ARM in gcc-4.7/changes.html: unaligned accesses
@ 2012-06-08  0:31 Hans-Peter Nilsson
  2012-06-08  3:20 ` Michael Hope
  2012-06-10 23:00 ` Gerald Pfeifer
  0 siblings, 2 replies; 19+ messages in thread
From: Hans-Peter Nilsson @ 2012-06-08  0:31 UTC (permalink / raw)
  To: gcc-patches; +Cc: richard.earnshaw

(CC to ARM maintainer approving the original patch.)

I'm listing this under "caveats" rather than "improvements" and
before the current top ARM-related caveat (as this one is more
important :) because I don't see performance figures in the
context of the original patch (r178852) backing up this as an
improvement, and it caused sort-of a wild goose hunt for
applications causing unaligned accesses, until it was found to be
deliberately emitted by gcc-4.7 when configured for
arm-unknown-linux-gnueabi and passing "-marmv6".  Hence caveat.
Nomenclature taken from that patch; if prefer a different
spelling of the ARM variants, please tell how.  The "some source
codes" was in the analyzed case a strcpy of a five-byte string
(busybox/libbb/procps.c:365 'strcpy(filename_tail, "stat");' of
some unknown busybox-version).

An OS configured with unaligned accesses turned off (IIUC the
default for Linux/ARM), has the nice property that you easily
spot a certain class of bad codes.

Ok to commit?

Alternatively and IMHO preferably, there's reason enough to
revert the (new) default, including the gcc-4.7 branch.

Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.7/changes.html,v
retrieving revision 1.113
diff -p -u -r1.113 changes.html
--- changes.html	5 Jun 2012 11:03:53 -0000	1.113
+++ changes.html	8 Jun 2012 00:01:09 -0000
@@ -43,6 +43,16 @@
 
     </li>
 
+    <li>On ARM, when compiling for ARMv6 (but not ARMv6-M), ARMv7-A,
+    ARMv7-R, or ARMv7-M, the default of the new option
+    <code>-munaligned-accesses</code> is on, which for some source
+    codes generates code that accesses memory on unaligned adresses.
+    This will require the OS of those systems to enable such accesses
+    (controlled by CP15 register c1, refer to ARM documentation).
+    Alternatively or for compatibility with OS versions that do not
+    enable unaligned accesses, all codes has to be compiled with
+    <code>-mno-unaligned-accesses</code>.</li>
+
     <li>Support on ARM for the legacy floating-point accelerator (FPA) and
     the mixed-endian floating-point format that it used has been obsoleted.
     The ports that still use this format have been obsoleted as well.

brgds, H-P

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2012-12-29 17:36 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-08  0:31 [RFA:] Caveat for ARM in gcc-4.7/changes.html: unaligned accesses Hans-Peter Nilsson
2012-06-08  3:20 ` Michael Hope
2012-06-08  3:51   ` Hans-Peter Nilsson
2012-06-08  4:29     ` Michael Hope
2012-06-08  4:53       ` Hans-Peter Nilsson
2012-06-08  5:17         ` Hans-Peter Nilsson
2012-06-10 22:27           ` Michael Hope
2012-06-10 23:16             ` Hans-Peter Nilsson
2012-06-12 14:37               ` Hans-Peter Nilsson
2012-06-12 23:15                 ` Michael Hope
2012-06-13  2:19                   ` Hans-Peter Nilsson
2012-06-10 23:00 ` Gerald Pfeifer
2012-06-11  1:29   ` Hans-Peter Nilsson
2012-06-13 13:55     ` Hans-Peter Nilsson
2012-06-15  3:40       ` [RFA:] Caveat for ARM in gcc-4.7/changes.html: unaligned accesses, take 2 Hans-Peter Nilsson
2012-06-22  7:20         ` Ping: " Hans-Peter Nilsson
2012-06-29 13:35           ` Hans-Peter Nilsson
2012-07-08  1:10             ` Ping again: " Hans-Peter Nilsson
2012-12-29 17:36         ` Gerald Pfeifer

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 read-only IMAP folder(s) and NNTP newsgroup(s).