https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162
--- Comment #9 from deller at gmx dot de ---
On 9/1/21 11:25 PM, deller at gmx dot de wrote:
> The "ldh" loads only the first two bytes, and extends it into the upper 32bits
> with "extrw,s".
> So, only 16bits instead of 32bits are loaded from the address where "evil"
> is...
Forget this!
My testcase was wrong. Here is the correct testcase which then loads 32bits:
short evil;
int f_unaligned2(void)
{ return get_unaligned((unsigned long *)&evil); }
00000000 <f_unaligned2>:
0: 2b 60 00 00 addil L%0,dp,r1
4: 34 33 00 00 ldo 0(r1),r19
8: 44 3c 00 00 ldh 0(r1),ret0
c: d7 9c 0a 10 depw,z ret0,15,16,ret0
10: 0e 64 10 53 ldh 2(r19),r19
14: e8 40 c0 00 bv r0(rp)
18: 0b 93 02 5c or r19,ret0,ret0