Richard Biener changed bug 1188327
What Removed Added
Flags needinfo?(rguenther@suse.com)  

Comment # 12 on bug 1188327 from
(In reply to Mian Yousaf Kaukab from comment #8)
> Please confirm that compiler inferring LDM instruction instead of LDR is
> correct for ecc_swap_digits(). 
> 
> In armv7, LDR instruction can handle unaligned address whereas LDM
> instruction can't handle them [1].
> 
> [1]:
> https://developer.arm.com/documentation/ddi0406/c/Application-Level-
> Architecture/Application-Level-Memory-Model/Alignment-support/Unaligned-data-
> access

I can find

static inline void ecc_swap_digits(const u64 *in, u64 *out,
                   unsigned int ndigits)
{
    int i;

    for (i = 0; i < ndigits; i++)
        out[i] = __swab64(in[ndigits - 1 - i]);
}

where yes, the compiler is correctly infering 64bit alignment for the
load in[ndigits - 1 - 1] because in is of type u64 *.  The instance where
it doesn't likely knows better from where it is inlined to (we don't
try to actively break things when we're faced with a 100% sure unaligned
access).


You are receiving this mail because: