https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121681

--- Comment #1 from Sergey V. Lobanov <sergey at lobanov dot in> ---
BTW, I've found that spacemit's GCC generates optimized code with unaligned
access if I set mcpu=spacemit-x60, but unfortunately they don't provide GCC
source code (at least I can't find source for their toolchain)

https://archive.spacemit.com/toolchain/spacemit-toolchain-linux-glibc-x86_64-v1.1.2.tar.xz

spacemit-toolchain-linux-glibc-x86_64-v1.1.2/bin$
./riscv64-unknown-linux-gnu-gcc -O3 -mcpu=spacemit-x60 2.c

./a.out disasm:
00000000000103f0 <main>:
   103f0:       619c                    ld      a5,0(a1)
   103f2:       97aa                    add     a5,a5,a0
   103f4:       4388                    lw      a0,0(a5)
   103f6:       8082                    ret

Reply via email to