else if (!TARGET_MUL_OPTS_P (opts) && TARGET_DIV_OPTS_P (opts))
error ("%<-mdiv%> requires %<-march%> to subsume the %<M%> extension");
+ /* We might use a multiplication to calculate the scalable vector length at
+ runtime. Therefore, require the M extension. */
+ if (TARGET_VECTOR && !TARGET_MUL)
+ sorry ("GCC's current %<V%> implementation requires the %<M%> extension");
+
/* Likewise floating-point division and square root. */
if ((TARGET_HARD_FLOAT_OPTS_P (opts) || TARGET_ZFINX_OPTS_P (opts))
&& ((target_flags_explicit & MASK_FDIV) == 0))
/* { dg-do compile } */
-/* { dg-options "-march=rv32i_zvfbfmin -mabi=ilp32f" } */
+/* { dg-options "-march=rv32im_zvfbfmin -mabi=ilp32f" } */
int foo()
{
}
/* { dg-do compile } */
-/* { dg-options "-march=rv64iv_zvfbfmin -mabi=lp64d" } */
+/* { dg-options "-march=rv64imv_zvfbfmin -mabi=lp64d" } */
int foo()
{
}
/* { dg-do compile } */
-/* { dg-options "-march=rv32i_zvfbfwma -mabi=ilp32f" } */
+/* { dg-options "-march=rv32im_zvfbfwma -mabi=ilp32f" } */
int
foo ()
{}
/* { dg-do compile } */
-/* { dg-options "-march=rv64iv_zvfbfwma -mabi=lp64d" } */
+/* { dg-options "-march=rv64imv_zvfbfwma -mabi=lp64d" } */
int
foo ()
{}
/* { dg-do compile } */
-/* { dg-options "-O -fno-tree-ch --param=max-completely-peel-times=0 -march=rv64iv -mabi=lp64d -fcompare-debug" } */
+/* { dg-options "-O -fno-tree-ch --param=max-completely-peel-times=0 -march=rv64imv -mabi=lp64d -fcompare-debug" } */
void
/* { dg-do compile } */
-/* { dg-options "-O -fno-tree-ch --param=max-completely-peel-times=0 -march=rv64iv -mabi=lp64d -fno-dce -fschedule-insns -fcompare-debug" } */
+/* { dg-options "-O -fno-tree-ch --param=max-completely-peel-times=0 -march=rv64imv -mabi=lp64d -fno-dce -fschedule-insns -fcompare-debug" } */
#include "compare-debug-1.c"
/* { dg-do compile } */
-/* { dg-options "-march=rv32iv -mabi=ilp32 -mcmodel=medlow -misa-spec=2.2" } */
+/* { dg-options "-march=rv32imv -mabi=ilp32 -mcmodel=medlow -misa-spec=2.2" } */
int main () {
#error "__riscv_a"
#endif
-#if defined(__riscv_m)
-#error "__riscv_m"
+#if !defined(__riscv_mul)
+#error "__riscv_mul"
#endif
#if !defined(__riscv_f)
/* { dg-do compile } */
-/* { dg-options "-march=rv64iv_zvl512b -mabi=lp64 -mcmodel=medlow -misa-spec=2.2" } */
+/* { dg-options "-march=rv64imv_zvl512b -mabi=lp64 -mcmodel=medlow -misa-spec=2.2" } */
int main () {
#error "__riscv_a"
#endif
-#if defined(__riscv_m)
+#if !defined(__riscv_m)
#error "__riscv_m"
#endif
/* { dg-do compile } */
-/* { dg-options "-march=rv64i_zve64f -mabi=lp64 -mcmodel=medlow -misa-spec=2.2" } */
+/* { dg-options "-march=rv64im_zve64f -mabi=lp64 -mcmodel=medlow -misa-spec=2.2" } */
int main () {
#error "__riscv_a"
#endif
-#if defined(__riscv_m)
+#if !defined(__riscv_m)
#error "__riscv_m"
#endif
/* { dg-do compile } */
-/* { dg-options "-O2 -march=rv64i_zvfhmin -mabi=lp64f -mcmodel=medlow -misa-spec=20191213" } */
+/* { dg-options "-O2 -march=rv64im_zvfhmin -mabi=lp64f -mcmodel=medlow -misa-spec=20191213" } */
int main () {
#error "__riscv_i"
#endif
+#if !defined(__riscv_m)
+#error "__riscv_m"
+#endif
+
#if !defined(__riscv_f)
#error "__riscv_f"
#endif
/* { dg-do compile } */
-/* { dg-options "-O2 -march=rv64i_zvfh -mabi=lp64f -mcmodel=medlow -misa-spec=20191213" } */
+/* { dg-options "-O2 -march=rv64im_zvfh -mabi=lp64f -mcmodel=medlow -misa-spec=20191213" } */
int main () {
#error "__riscv_i"
#endif
+#if !defined(__riscv_m)
+#error "__riscv_m"
+#endif
+
#if !defined(__riscv_f)
#error "__riscv_f"
#endif
/* { dg-do compile } */
-/* { dg-options "-O2 -march=rv32i_zvfbfmin -mabi=ilp32f -mcmodel=medlow -misa-spec=20191213" } */
+/* { dg-options "-O2 -march=rv32im_zvfbfmin -mabi=ilp32f -mcmodel=medlow -misa-spec=20191213" } */
int main () {
#error "__riscv_i"
#endif
+#if !defined(__riscv_m)
+#error "__riscv_m"
+#endif
+
#if !defined(__riscv_f)
#error "__riscv_f"
#endif
/* { dg-do compile } */
-/* { dg-options "-O2 -march=rv64iv_zvfbfmin -mabi=lp64d -mcmodel=medlow -misa-spec=20191213" } */
+/* { dg-options "-O2 -march=rv64imv_zvfbfmin -mabi=lp64d -mcmodel=medlow -misa-spec=20191213" } */
int main () {
#error "__riscv_i"
#endif
+#if !defined(__riscv_m)
+#error "__riscv_m"
+#endif
+
#if !defined(__riscv_f)
#error "__riscv_f"
#endif
/* { dg-do compile } */
-/* { dg-options "-O2 -march=rv32i_zvfbfwma -mabi=ilp32f -mcmodel=medlow -misa-spec=20191213" } */
+/* { dg-options "-O2 -march=rv32im_zvfbfwma -mabi=ilp32f -mcmodel=medlow -misa-spec=20191213" } */
int
main ()
#error "__riscv_i"
#endif
+#if !defined(__riscv_m)
+#error "__riscv_m"
+#endif
+
#if !defined(__riscv_f)
#error "__riscv_f"
#endif
/* { dg-do compile } */
-/* { dg-options "-O2 -march=rv64iv_zvfbfwma -mabi=lp64d -mcmodel=medlow -misa-spec=20191213" } */
+/* { dg-options "-O2 -march=rv64imv_zvfbfwma -mabi=lp64d -mcmodel=medlow -misa-spec=20191213" } */
int
main ()
#error "__riscv_i"
#endif
+#if !defined(__riscv_m)
+#error "__riscv_m"
+#endif
+
#if !defined(__riscv_f)
#error "__riscv_f"
#endif
/* { dg-do compile } */
-/* { dg-options "-march=rv64iv -mabi=lp64d -O2" } */
+/* { dg-options "-march=rv64imv -mabi=lp64d -O2" } */
typedef char __attribute__((__vector_size__ (1))) V;
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-march=rv64idv -mabi=lp64d -O3" } */
+
+int a[15][15];
+void init() {
+ for (int i_0 ; i_0 < 15 ; ++i_0)
+ for (int i_1 = 0; i_1 < 15; ++i_1)
+ a[i_0][i_1] = 1;
+}
+
+/* { dg-excess-errors "sorry, unimplemented: GCC's current 'V' implementation requires the 'M' extension" } */