https://sourceware.org/bugzilla/show_bug.cgi?id=33095

            Bug ID: 33095
           Summary: as fails to respect -march on riscv when it doesn't
                    include the compressed instructions extension
           Product: binutils
           Version: 2.44
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: genericnerdyusername at proton dot me
  Target Milestone: ---

`as` can output binaries with instructions from the C extension, even when
disabled with `-march=rv32i`

Also seems to exist on 2.43.1. Haven't checked `riscv32-unknown-linux-gnu` or
64 bit variants.

I am using on nixos, linux 6.12.32, x86_64.

To reproduce:
save this as prog.S (I have a larger example, this was generated via creduce)
```
.ifnc(, 
.option rvc
.align 5
.endif
```
then run
```
riscv32-none-elf-as -march=rv32i prog.S -o prog.elf
riscv32-none-elf-objdump -Mno-aliases -d prog.elf
```
and it should output a disassembly with two `c.addi` instructions

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to