gcc/ChangeLog:
* common/config/riscv/riscv-common.cc
(riscv_subset_list::check_conflict_ext): Check zcd conflicts
with zcmt and zcmp.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/arch-29.c: New test.
* gcc.target/riscv/arch-30.c: New test.
/* 'H' hypervisor extension requires base ISA with 32 registers. */
if (lookup ("e") && lookup ("h"))
error_at (m_loc, "%<-march=%s%>: h extension requires i extension", m_arch);
+
+ if (lookup ("zcd"))
+ {
+ if (lookup ("zcmt"))
+ error_at (m_loc, "%<-march=%s%>: zcd conflicts with zcmt", m_arch);
+ if (lookup ("zcmp"))
+ error_at (m_loc, "%<-march=%s%>: zcd conflicts with zcmp", m_arch);
+ }
}
/* Parsing function for multi-letter extensions.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-march=rv64id_zcd_zcmt -mabi=lp64d" } */
+int foo()
+{
+}
+
+/* { dg-error "zcd conflicts with zcmt" "" { target *-*-* } 0 } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-march=rv64id_zcd_zcmp -mabi=lp64d" } */
+int foo()
+{
+}
+
+/* { dg-error "zcd conflicts with zcmp" "" { target *-*-* } 0 } */