Altera_Forum
Honored Contributor
21 years agoBug in NIOS2 GCC ?
Could this be a bug in the NIOS2-GCC ?
char testsub(void) {
return __builtin_ldbio (0x1000);
} Generates the following Assembly code (Using -O2 and -fomit-frame-pointer): movi r3, 4096
ldhio r2, 0(r3)
slli r2, r2, 24
srai r2, r2, 24
ret Why doesn't it just generate a ldbio r2, 0(r3) I also found the following Code in the (Nios Homedir)/bin/nios2-gnutools/src/gcc/gcc/config/nios2/nios2.md File (available only if GCC Sources are installed) : (define_insn "ldbio"
UNSPEC_LDBIO))
(use (match_operand:SI 1 "memory_operand" "m"))]
""
"ldhio\t%0, %1"
) Does anybody know why GCC translates every __builtin_ldbio into a ldhio?