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

            Bug ID: 33128
           Summary: GAS emits compressed instruction with .option arch, -c
           Product: binutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: Mr.Bossman075 at gmail dot com
  Target Milestone: ---

GAS emits compressed instructions when option `.option arch, -c` is present if
"zca" or "zcd" are in the march string. Interestingly `.option norvc` works
correctly still.

```
riscv64-linux-as -march=rv64g_zca_zcd -c -o example.o  example.s &&
riscv64-linux-objdump -d example.o
```

Here is the toolchain used:
https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/15.1.0/x86_64-gcc-15.1.0-nolibc-riscv64-linux.tar.xz

```
.option arch, +c

example:
        li a5, 0
        .option push
        .option arch, -c
        sw a5, 0(a5)
        .option pop
        ret
```

Expected result:
riscv64-linux-as -march=rv64g -c -o example.o  example.s:
```
   0:   4781                    li      a5,0
   2:   00f7a023                sw      a5,0(a5)
   6:   8082                    ret
```

Unexpected result:
riscv64-linux-as -march=rv64g_zca_zcd -c -o example.o  example.s:
```
   0:   4781                    li      a5,0
   2:   c39c                    sw      a5,0(a5)
   4:   8082                    ret
```

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

Reply via email to