[PATCH] RISC-V: Add support for addi that compresses to c.nop.

Sebastian Huber sebastian.huber@embedded-brains.de
Wed Jan 17 07:33:00 GMT 2018


On 15/01/18 23:57, Jim Wilson wrote:
> This fixes a bug reported against the github riscv/riscv-binutils-gdb project.
>      https://github.com/riscv/riscv-binutils-gdb/issues/135
>
> This fixes a minor oversight.  An addi x0,x0,0 is a nop, and should compress
> to c.nop when RVC support is enabled, but without this patch we always get
> a 4-byte nop.  With this patch, we get the expected 2-byte nop.
>
> This was tested with rv{32,64}-{elf,linux} make check-{binutils,gas,ld}.  There
> were no regressions.

Maybe this change broke the GCC build (riscv32-rtems5 and riscv64-rtems5 
targets):

/home/sh/b-gcc-riscv32/./gcc/xgcc -B/home/sh/b-gcc-riscv32/./gcc/ 
-nostdinc -B/home/sh/b-gcc-riscv32/riscv32-rtems5/newlib/ -isystem 
/home/sh/b-gcc-riscv32/riscv32-rtems5/newlib/targ-include -isystem 
/home/sh/src/gcc/newlib/libc/include 
-B/home/sh/install/riscv32-rtems5/bin/ 
-B/home/sh/install/riscv32-rtems5/lib/ -isystem 
/home/sh/install/riscv32-rtems5/include -isystem 
/home/sh/install/riscv32-rtems5/sys-include    -g -O2 -march=rv32i 
-mabi=ilp32 -O2 
-I/home/sh/src/gcc/libgcc/../newlib/libc/sys/rtems/include -g -O2 
-DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing 
-Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes 
-Wold-style-definition  -isystem ./include   -g -DIN_LIBGCC2 
-fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -I. -I. 
-I../../../.././gcc -I/home/sh/src/gcc/libgcc 
-I/home/sh/src/gcc/libgcc/. -I/home/sh/src/gcc/libgcc/../gcc 
-I/home/sh/src/gcc/libgcc/../include  -DHAVE_CC_TLS  -o _ffssi2.o -MT 
_ffssi2.o -MD -MP -MF _ffssi2.dep -DL_ffssi2 -c 
/home/sh/src/gcc/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS 
-save-temps
libgcc2.s: Assembler messages:
libgcc2.s:53: Error: bad expression
libgcc2.s:73: Error: bad expression
libgcc2.s:107: Error: bad expression
libgcc2.s:134: Error: bad expression

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: libgcc2.s
Type: text/x-asm
Size: 14451 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20180117/3e4e379e/attachment.bin>


More information about the Binutils mailing list