Re: [PATCH maint-1.6.5] block-sha1: avoid unaligned accesses on some big-endian systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linus Torvalds wrote:
> On Sat, Jul 14, 2012 at 12:59 AM, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:

>> Unfortunately, on big-endian architectures, if p is a pointer to
>> unsigned int then current gcc assumes it is properly aligned and
>> converts this construct to a 32-bit load.
>
> This patch seems to entirely depend on the location of the cast. And
> as far as I can tell, that workaround will in turn depend on just what
> gets inlined.

After the patch, what reason does gcc have to expect that 'block' is
32-bit aligned except when it is?  The code (including the code I
didn't touch) never casts from char * to int * except in get/put_be32
on arches that don't mind unaligned accesses.

[...]
> Anyway, the whole "noticed on alpha" makes no sense, since alpha isn't
> even big-endian. So the commit log is insane and misleading too.

Yes, true.  Thanks for catching it.

Jonathan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]