[Bug target/23066] loading a word from an unknown alignment.

rearnsha at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Jul 28 17:06:00 GMT 2005


------- Additional Comments From rearnsha at gcc dot gnu dot org  2005-07-28 17:01 -------
It's true that for older cores (eg arm7) that the code you suggest is slightly
faster, but for it to be safe to use it must be possible to determine that when
the object *is* aligned then the second word will not cause an access violation
(ie by going beyond the end of a page, or into device space, etc).

On more modern cores which have load delay slots, its less clear that the
proposed change is beneficial:
1) On XScale LDM is *very* slow
2) The little-endian version currently generated by the compiler takes 7 cycles
if the loaded value is in the cache, whereas your proposed alternative takes at
least 10 because of the register shifts.

So overall, I'm not convinced that it's worth trying to do this (even for an
ARM7 the showstopper is proving that the sequence is safe -- even though it will
almost always be).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23066



More information about the Gcc-bugs mailing list