Sorry for the late reply. Which build of gcc?Hello.
I'm programming in RISCV assembly without the SDK, using the riscv32-unknown-elf-as compiler.
I've run some tests to use the compression options listed in the documentation.
The `Zcmp` option is not accepted because it contains an uppercase letter.
The `zcmp` and `zcb` options are rejected by the compiler.
The `c` option is accepted and does indeed reduce the instruction size.
For example, `li a0,25` translates to the code `01900513` (4 bytes) without the option and `4565` (2 bytes) with the option. However, the reduced instruction `add t0,t1` is still not accepted.
In a small program with a size of 0x35C without the `c` option, the size is reduced to 0x292 bytes with the option.
Code:
riscv32-unknown-elf-gcc -vI believe GCC optimizes to op codes seen in the binary, but I don't think the assembler supports using them directly from assembly language yet.
Statistics: Posted by breaker — Thu May 28, 2026 6:41 pm





