Bug 30873 - [RISC-V] On the failure of ".option arch, +/-" caused by implicit derivation of Zc extension
Summary: [RISC-V] On the failure of ".option arch, +/-" caused by implicit derivation ...
Status: UNCONFIRMED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.42
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-19 10:28 UTC by liu xu
Modified: 2023-09-19 10:28 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description liu xu 2023-09-19 10:28:40 UTC
Hi,
 Since Zca is implicited by Zcb/Zcf/Zcd, when I want to restrict part of my assembly code from compiling without the Zc extension(eg:march=rv32ima_zca_zcb_zcf_zcd), I must use the ".option arch, -" like below:

  .option push
  .option arch, -zcb
  .option arch, -zcf
  .option arch, -zcd
  .option arch, -zca

  add	x3, x3, x27
  ...
  .option pop

If I write like:

  .option push
  .option arch, -zca
  .option arch, -zcb
  .option arch, -zcf
  .option arch, -zcd

  add	x3, x3, x27
  ...
  .option pop

then the ".option arch, -zca" will not work.

So I want to know if this implicit derivation relationship of Zc is necessary, or if there is a better way to solve the ".option arch, -" of Zc.

Thanks!