* [PATCH v1] RISC-V: Add test cases for insn does not satisfy its constraints [PR114714]
@ 2024-04-25 9:25 pan2.li
2024-04-25 9:27 ` juzhe.zhong
0 siblings, 1 reply; 3+ messages in thread
From: pan2.li @ 2024-04-25 9:25 UTC (permalink / raw)
To: gcc-patches; +Cc: juzhe.zhong, kito.cheng, rdapp.gcc, Pan Li, Kito Cheng
From: Pan Li <pan2.li@intel.com>
We have one ICE when RVV register overlap is enabled. We reverted this
feature as it is in stage 4 and there is no much time to figure a better
solution for this. Thus, for now add the related test cases which will
trigger ICE when register overlap enabled.
This will gate the RVV register overlap support in GCC-15.
PR target/114714
gcc/testsuite/ChangeLog:
* g++.target/riscv/rvv/base/pr114714-1.C: New test.
* g++.target/riscv/rvv/base/pr114714-2.C: New test.
Signed-off-by: Pan Li <pan2.li@intel.com>
Co-Authored-by: Kito Cheng <kito.cheng@sifive.com>
---
.../g++.target/riscv/rvv/base/pr114714-1.C | 85 +++++++++++++++++++
.../g++.target/riscv/rvv/base/pr114714-2.C | 85 +++++++++++++++++++
2 files changed, 170 insertions(+)
create mode 100644 gcc/testsuite/g++.target/riscv/rvv/base/pr114714-1.C
create mode 100644 gcc/testsuite/g++.target/riscv/rvv/base/pr114714-2.C
diff --git a/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-1.C b/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-1.C
new file mode 100644
index 00000000000..d3230f7f23e
--- /dev/null
+++ b/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-1.C
@@ -0,0 +1,85 @@
+/* Test that we do not have ice when compile */
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -std=c++17" } */
+
+typedef int a;
+typedef short b;
+typedef unsigned c;
+template < typename > using e = unsigned;
+template < typename > void ab();
+#pragma riscv intrinsic "vector"
+template < typename f, int, int ac > struct g {
+ using i = f;
+ template < typename m > using j = g< m, 0, ac >;
+ using k = g< i, 1, ac - 1 >;
+ using ad = g< i, 1, ac + 1 >;
+};
+namespace ae {
+struct af {
+ using h = g< short, 6, 0 < 3 >;
+};
+struct ag {
+ using h = af::h;
+};
+} template < typename, int > using ah = ae::ag::h;
+template < class ai > using aj = typename ai::i;
+template < class i, class ai > using j = typename ai::j< i >;
+template < class ai > using ak = j< e< ai >, ai >;
+template < class ai > using k = typename ai::k;
+template < class ai > using ad = typename ai::ad;
+template < a ap > vuint16m1_t ar(g< b, ap, 0 >, b);
+template < a ap > vuint16m2_t ar(g< b, ap, 1 >, b);
+template < a ap > vuint32m2_t ar(g< c, ap, 1 >, c);
+template < a ap > vuint32m4_t ar(g< c, ap, 2 >, c);
+template < class ai > using as = decltype(ar(ai(), aj< ai >()));
+template < class ai > as< ai > at(ai);
+namespace ae {
+template < int ap > vuint32m4_t au(g< c, ap, 1 + 1 >, vuint32m2_t l) {
+ return __riscv_vlmul_ext_v_u32m2_u32m4(l);
+}
+} template < int ap > vuint32m2_t aw(g< c, ap, 1 >, vuint16m1_t l) {
+ return __riscv_vzext_vf2_u32m2(l, 0);
+}
+namespace ae {
+vuint32m4_t ax(vuint32m4_t, vuint32m4_t, a);
+}
+template < class ay, class an > as< ay > az(ay ba, an bc) {
+ an bb;
+ return ae::ax(ae::au(ba, bc), ae::au(ba, bb), 2);
+}
+template < class bd > as< bd > be(bd, as< ad< bd > >);
+namespace ae {
+template < class bh, class bi > void bj(bh bk, bi bl) {
+ ad< decltype(bk) > bn;
+ az(bn, bl);
+}
+} template < int ap, int ac, class bp, class bq >
+void br(g< c, ap, ac > bk, bp, bq bl) {
+ ae::bj(bk, bl);
+}
+template < class ai > using bs = decltype(at(ai()));
+struct bt;
+template < int ac = 1 > class bu {
+public:
+ template < typename i > void operator()(i) {
+ ah< i, ac > d;
+ bt()(i(), d);
+ }
+};
+struct bt {
+ template < typename bv, class bf > void operator()(bv, bf bw) {
+ using bx = bv;
+ ak< bf > by;
+ k< bf > bz;
+ using bq = bs< decltype(by) >;
+ using bp = bs< decltype(bw) >;
+ bp cb;
+ ab< bx >();
+ for (;;) {
+ bp cc;
+ bq bl = aw(by, be(bz, cc));
+ br(by, cb, bl);
+ }
+ }
+};
+void d() { bu()(b()); }
diff --git a/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-2.C b/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-2.C
new file mode 100644
index 00000000000..55621e98fee
--- /dev/null
+++ b/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-2.C
@@ -0,0 +1,85 @@
+/* Test that we do not have ice when compile */
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -std=c++17" } */
+
+typedef int a;
+typedef short b;
+typedef unsigned c;
+template < typename > using e = unsigned;
+template < typename > void ab();
+#pragma riscv intrinsic "vector"
+template < typename f, int, int ac > struct g {
+ using i = f;
+ template < typename m > using j = g< m, 0, ac >;
+ using k = g< i, 1, ac - 1 >;
+ using ad = g< i, 1, ac + 1 >;
+};
+namespace ae {
+struct af {
+ using h = g< short, 6, 0 < 3 >;
+};
+struct ag {
+ using h = af::h;
+};
+} template < typename, int > using ah = ae::ag::h;
+template < class ai > using aj = typename ai::i;
+template < class i, class ai > using j = typename ai::j< i >;
+template < class ai > using ak = j< e< ai >, ai >;
+template < class ai > using k = typename ai::k;
+template < class ai > using ad = typename ai::ad;
+template < a ap > vuint16mf2_t ar(g< b, ap, 0 >, b);
+template < a ap > vuint16m1_t ar(g< b, ap, 1 >, b);
+template < a ap > vuint32m1_t ar(g< c, ap, 1 >, c);
+template < a ap > vuint32m2_t ar(g< c, ap, 2 >, c);
+template < class ai > using as = decltype(ar(ai(), aj< ai >()));
+template < class ai > as< ai > at(ai);
+namespace ae {
+template < int ap > vuint32m2_t au(g< c, ap, 1 + 1 >, vuint32m1_t l) {
+ return __riscv_vlmul_ext_v_u32m1_u32m2(l);
+}
+} template < int ap > vuint32m1_t aw(g< c, ap, 1 >, vuint16mf2_t l) {
+ return __riscv_vzext_vf2_u32m1(l, 0);
+}
+namespace ae {
+vuint32m2_t ax(vuint32m2_t, vuint32m2_t, a);
+}
+template < class ay, class an > as< ay > az(ay ba, an bc) {
+ an bb;
+ return ae::ax(ae::au(ba, bc), ae::au(ba, bb), 2);
+}
+template < class bd > as< bd > be(bd, as< ad< bd > >);
+namespace ae {
+template < class bh, class bi > void bj(bh bk, bi bl) {
+ ad< decltype(bk) > bn;
+ az(bn, bl);
+}
+} template < int ap, int ac, class bp, class bq >
+void br(g< c, ap, ac > bk, bp, bq bl) {
+ ae::bj(bk, bl);
+}
+template < class ai > using bs = decltype(at(ai()));
+struct bt;
+template < int ac = 1 > class bu {
+public:
+ template < typename i > void operator()(i) {
+ ah< i, ac > d;
+ bt()(i(), d);
+ }
+};
+struct bt {
+ template < typename bv, class bf > void operator()(bv, bf bw) {
+ using bx = bv;
+ ak< bf > by;
+ k< bf > bz;
+ using bq = bs< decltype(by) >;
+ using bp = bs< decltype(bw) >;
+ bp cb;
+ ab< bx >();
+ for (;;) {
+ bp cc;
+ bq bl = aw(by, be(bz, cc));
+ br(by, cb, bl);
+ }
+ }
+};
+void d() { bu()(b()); }
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] RISC-V: Add test cases for insn does not satisfy its constraints [PR114714]
2024-04-25 9:25 [PATCH v1] RISC-V: Add test cases for insn does not satisfy its constraints [PR114714] pan2.li
@ 2024-04-25 9:27 ` juzhe.zhong
2024-04-25 10:30 ` Li, Pan2
0 siblings, 1 reply; 3+ messages in thread
From: juzhe.zhong @ 2024-04-25 9:27 UTC (permalink / raw)
To: pan2.li, gcc-patches; +Cc: kito.cheng, Robin Dapp, pan2.li, Kito.cheng
[-- Attachment #1: Type: text/plain, Size: 7014 bytes --]
LGTM. THANKS
juzhe.zhong@rivai.ai
From: pan2.li
Date: 2024-04-25 17:25
To: gcc-patches
CC: juzhe.zhong; kito.cheng; rdapp.gcc; Pan Li; Kito Cheng
Subject: [PATCH v1] RISC-V: Add test cases for insn does not satisfy its constraints [PR114714]
From: Pan Li <pan2.li@intel.com>
We have one ICE when RVV register overlap is enabled. We reverted this
feature as it is in stage 4 and there is no much time to figure a better
solution for this. Thus, for now add the related test cases which will
trigger ICE when register overlap enabled.
This will gate the RVV register overlap support in GCC-15.
PR target/114714
gcc/testsuite/ChangeLog:
* g++.target/riscv/rvv/base/pr114714-1.C: New test.
* g++.target/riscv/rvv/base/pr114714-2.C: New test.
Signed-off-by: Pan Li <pan2.li@intel.com>
Co-Authored-by: Kito Cheng <kito.cheng@sifive.com>
---
.../g++.target/riscv/rvv/base/pr114714-1.C | 85 +++++++++++++++++++
.../g++.target/riscv/rvv/base/pr114714-2.C | 85 +++++++++++++++++++
2 files changed, 170 insertions(+)
create mode 100644 gcc/testsuite/g++.target/riscv/rvv/base/pr114714-1.C
create mode 100644 gcc/testsuite/g++.target/riscv/rvv/base/pr114714-2.C
diff --git a/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-1.C b/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-1.C
new file mode 100644
index 00000000000..d3230f7f23e
--- /dev/null
+++ b/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-1.C
@@ -0,0 +1,85 @@
+/* Test that we do not have ice when compile */
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -std=c++17" } */
+
+typedef int a;
+typedef short b;
+typedef unsigned c;
+template < typename > using e = unsigned;
+template < typename > void ab();
+#pragma riscv intrinsic "vector"
+template < typename f, int, int ac > struct g {
+ using i = f;
+ template < typename m > using j = g< m, 0, ac >;
+ using k = g< i, 1, ac - 1 >;
+ using ad = g< i, 1, ac + 1 >;
+};
+namespace ae {
+struct af {
+ using h = g< short, 6, 0 < 3 >;
+};
+struct ag {
+ using h = af::h;
+};
+} template < typename, int > using ah = ae::ag::h;
+template < class ai > using aj = typename ai::i;
+template < class i, class ai > using j = typename ai::j< i >;
+template < class ai > using ak = j< e< ai >, ai >;
+template < class ai > using k = typename ai::k;
+template < class ai > using ad = typename ai::ad;
+template < a ap > vuint16m1_t ar(g< b, ap, 0 >, b);
+template < a ap > vuint16m2_t ar(g< b, ap, 1 >, b);
+template < a ap > vuint32m2_t ar(g< c, ap, 1 >, c);
+template < a ap > vuint32m4_t ar(g< c, ap, 2 >, c);
+template < class ai > using as = decltype(ar(ai(), aj< ai >()));
+template < class ai > as< ai > at(ai);
+namespace ae {
+template < int ap > vuint32m4_t au(g< c, ap, 1 + 1 >, vuint32m2_t l) {
+ return __riscv_vlmul_ext_v_u32m2_u32m4(l);
+}
+} template < int ap > vuint32m2_t aw(g< c, ap, 1 >, vuint16m1_t l) {
+ return __riscv_vzext_vf2_u32m2(l, 0);
+}
+namespace ae {
+vuint32m4_t ax(vuint32m4_t, vuint32m4_t, a);
+}
+template < class ay, class an > as< ay > az(ay ba, an bc) {
+ an bb;
+ return ae::ax(ae::au(ba, bc), ae::au(ba, bb), 2);
+}
+template < class bd > as< bd > be(bd, as< ad< bd > >);
+namespace ae {
+template < class bh, class bi > void bj(bh bk, bi bl) {
+ ad< decltype(bk) > bn;
+ az(bn, bl);
+}
+} template < int ap, int ac, class bp, class bq >
+void br(g< c, ap, ac > bk, bp, bq bl) {
+ ae::bj(bk, bl);
+}
+template < class ai > using bs = decltype(at(ai()));
+struct bt;
+template < int ac = 1 > class bu {
+public:
+ template < typename i > void operator()(i) {
+ ah< i, ac > d;
+ bt()(i(), d);
+ }
+};
+struct bt {
+ template < typename bv, class bf > void operator()(bv, bf bw) {
+ using bx = bv;
+ ak< bf > by;
+ k< bf > bz;
+ using bq = bs< decltype(by) >;
+ using bp = bs< decltype(bw) >;
+ bp cb;
+ ab< bx >();
+ for (;;) {
+ bp cc;
+ bq bl = aw(by, be(bz, cc));
+ br(by, cb, bl);
+ }
+ }
+};
+void d() { bu()(b()); }
diff --git a/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-2.C b/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-2.C
new file mode 100644
index 00000000000..55621e98fee
--- /dev/null
+++ b/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-2.C
@@ -0,0 +1,85 @@
+/* Test that we do not have ice when compile */
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -std=c++17" } */
+
+typedef int a;
+typedef short b;
+typedef unsigned c;
+template < typename > using e = unsigned;
+template < typename > void ab();
+#pragma riscv intrinsic "vector"
+template < typename f, int, int ac > struct g {
+ using i = f;
+ template < typename m > using j = g< m, 0, ac >;
+ using k = g< i, 1, ac - 1 >;
+ using ad = g< i, 1, ac + 1 >;
+};
+namespace ae {
+struct af {
+ using h = g< short, 6, 0 < 3 >;
+};
+struct ag {
+ using h = af::h;
+};
+} template < typename, int > using ah = ae::ag::h;
+template < class ai > using aj = typename ai::i;
+template < class i, class ai > using j = typename ai::j< i >;
+template < class ai > using ak = j< e< ai >, ai >;
+template < class ai > using k = typename ai::k;
+template < class ai > using ad = typename ai::ad;
+template < a ap > vuint16mf2_t ar(g< b, ap, 0 >, b);
+template < a ap > vuint16m1_t ar(g< b, ap, 1 >, b);
+template < a ap > vuint32m1_t ar(g< c, ap, 1 >, c);
+template < a ap > vuint32m2_t ar(g< c, ap, 2 >, c);
+template < class ai > using as = decltype(ar(ai(), aj< ai >()));
+template < class ai > as< ai > at(ai);
+namespace ae {
+template < int ap > vuint32m2_t au(g< c, ap, 1 + 1 >, vuint32m1_t l) {
+ return __riscv_vlmul_ext_v_u32m1_u32m2(l);
+}
+} template < int ap > vuint32m1_t aw(g< c, ap, 1 >, vuint16mf2_t l) {
+ return __riscv_vzext_vf2_u32m1(l, 0);
+}
+namespace ae {
+vuint32m2_t ax(vuint32m2_t, vuint32m2_t, a);
+}
+template < class ay, class an > as< ay > az(ay ba, an bc) {
+ an bb;
+ return ae::ax(ae::au(ba, bc), ae::au(ba, bb), 2);
+}
+template < class bd > as< bd > be(bd, as< ad< bd > >);
+namespace ae {
+template < class bh, class bi > void bj(bh bk, bi bl) {
+ ad< decltype(bk) > bn;
+ az(bn, bl);
+}
+} template < int ap, int ac, class bp, class bq >
+void br(g< c, ap, ac > bk, bp, bq bl) {
+ ae::bj(bk, bl);
+}
+template < class ai > using bs = decltype(at(ai()));
+struct bt;
+template < int ac = 1 > class bu {
+public:
+ template < typename i > void operator()(i) {
+ ah< i, ac > d;
+ bt()(i(), d);
+ }
+};
+struct bt {
+ template < typename bv, class bf > void operator()(bv, bf bw) {
+ using bx = bv;
+ ak< bf > by;
+ k< bf > bz;
+ using bq = bs< decltype(by) >;
+ using bp = bs< decltype(bw) >;
+ bp cb;
+ ab< bx >();
+ for (;;) {
+ bp cc;
+ bq bl = aw(by, be(bz, cc));
+ br(by, cb, bl);
+ }
+ }
+};
+void d() { bu()(b()); }
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH v1] RISC-V: Add test cases for insn does not satisfy its constraints [PR114714]
2024-04-25 9:27 ` juzhe.zhong
@ 2024-04-25 10:30 ` Li, Pan2
0 siblings, 0 replies; 3+ messages in thread
From: Li, Pan2 @ 2024-04-25 10:30 UTC (permalink / raw)
To: juzhe.zhong, gcc-patches; +Cc: kito.cheng, Robin Dapp, Kito.cheng
[-- Attachment #1: Type: text/plain, Size: 7785 bytes --]
Committed, thanks Juzhe.
Pan
From: juzhe.zhong@rivai.ai <juzhe.zhong@rivai.ai>
Sent: Thursday, April 25, 2024 5:27 PM
To: Li, Pan2 <pan2.li@intel.com>; gcc-patches <gcc-patches@gcc.gnu.org>
Cc: kito.cheng <kito.cheng@gmail.com>; Robin Dapp <rdapp.gcc@gmail.com>; Li, Pan2 <pan2.li@intel.com>; Kito.cheng <kito.cheng@sifive.com>
Subject: Re: [PATCH v1] RISC-V: Add test cases for insn does not satisfy its constraints [PR114714]
LGTM. THANKS
________________________________
juzhe.zhong@rivai.ai<mailto:juzhe.zhong@rivai.ai>
From: pan2.li<mailto:pan2.li@intel.com>
Date: 2024-04-25 17:25
To: gcc-patches<mailto:gcc-patches@gcc.gnu.org>
CC: juzhe.zhong<mailto:juzhe.zhong@rivai.ai>; kito.cheng<mailto:kito.cheng@gmail.com>; rdapp.gcc<mailto:rdapp.gcc@gmail.com>; Pan Li<mailto:pan2.li@intel.com>; Kito Cheng<mailto:kito.cheng@sifive.com>
Subject: [PATCH v1] RISC-V: Add test cases for insn does not satisfy its constraints [PR114714]
From: Pan Li <pan2.li@intel.com<mailto:pan2.li@intel.com>>
We have one ICE when RVV register overlap is enabled. We reverted this
feature as it is in stage 4 and there is no much time to figure a better
solution for this. Thus, for now add the related test cases which will
trigger ICE when register overlap enabled.
This will gate the RVV register overlap support in GCC-15.
PR target/114714
gcc/testsuite/ChangeLog:
* g++.target/riscv/rvv/base/pr114714-1.C: New test.
* g++.target/riscv/rvv/base/pr114714-2.C: New test.
Signed-off-by: Pan Li <pan2.li@intel.com<mailto:pan2.li@intel.com>>
Co-Authored-by: Kito Cheng <kito.cheng@sifive.com<mailto:kito.cheng@sifive.com>>
---
.../g++.target/riscv/rvv/base/pr114714-1.C | 85 +++++++++++++++++++
.../g++.target/riscv/rvv/base/pr114714-2.C | 85 +++++++++++++++++++
2 files changed, 170 insertions(+)
create mode 100644 gcc/testsuite/g++.target/riscv/rvv/base/pr114714-1.C
create mode 100644 gcc/testsuite/g++.target/riscv/rvv/base/pr114714-2.C
diff --git a/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-1.C b/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-1.C
new file mode 100644
index 00000000000..d3230f7f23e
--- /dev/null
+++ b/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-1.C
@@ -0,0 +1,85 @@
+/* Test that we do not have ice when compile */
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -std=c++17" } */
+
+typedef int a;
+typedef short b;
+typedef unsigned c;
+template < typename > using e = unsigned;
+template < typename > void ab();
+#pragma riscv intrinsic "vector"
+template < typename f, int, int ac > struct g {
+ using i = f;
+ template < typename m > using j = g< m, 0, ac >;
+ using k = g< i, 1, ac - 1 >;
+ using ad = g< i, 1, ac + 1 >;
+};
+namespace ae {
+struct af {
+ using h = g< short, 6, 0 < 3 >;
+};
+struct ag {
+ using h = af::h;
+};
+} template < typename, int > using ah = ae::ag::h;
+template < class ai > using aj = typename ai::i;
+template < class i, class ai > using j = typename ai::j< i >;
+template < class ai > using ak = j< e< ai >, ai >;
+template < class ai > using k = typename ai::k;
+template < class ai > using ad = typename ai::ad;
+template < a ap > vuint16m1_t ar(g< b, ap, 0 >, b);
+template < a ap > vuint16m2_t ar(g< b, ap, 1 >, b);
+template < a ap > vuint32m2_t ar(g< c, ap, 1 >, c);
+template < a ap > vuint32m4_t ar(g< c, ap, 2 >, c);
+template < class ai > using as = decltype(ar(ai(), aj< ai >()));
+template < class ai > as< ai > at(ai);
+namespace ae {
+template < int ap > vuint32m4_t au(g< c, ap, 1 + 1 >, vuint32m2_t l) {
+ return __riscv_vlmul_ext_v_u32m2_u32m4(l);
+}
+} template < int ap > vuint32m2_t aw(g< c, ap, 1 >, vuint16m1_t l) {
+ return __riscv_vzext_vf2_u32m2(l, 0);
+}
+namespace ae {
+vuint32m4_t ax(vuint32m4_t, vuint32m4_t, a);
+}
+template < class ay, class an > as< ay > az(ay ba, an bc) {
+ an bb;
+ return ae::ax(ae::au(ba, bc), ae::au(ba, bb), 2);
+}
+template < class bd > as< bd > be(bd, as< ad< bd > >);
+namespace ae {
+template < class bh, class bi > void bj(bh bk, bi bl) {
+ ad< decltype(bk) > bn;
+ az(bn, bl);
+}
+} template < int ap, int ac, class bp, class bq >
+void br(g< c, ap, ac > bk, bp, bq bl) {
+ ae::bj(bk, bl);
+}
+template < class ai > using bs = decltype(at(ai()));
+struct bt;
+template < int ac = 1 > class bu {
+public:
+ template < typename i > void operator()(i) {
+ ah< i, ac > d;
+ bt()(i(), d);
+ }
+};
+struct bt {
+ template < typename bv, class bf > void operator()(bv, bf bw) {
+ using bx = bv;
+ ak< bf > by;
+ k< bf > bz;
+ using bq = bs< decltype(by) >;
+ using bp = bs< decltype(bw) >;
+ bp cb;
+ ab< bx >();
+ for (;;) {
+ bp cc;
+ bq bl = aw(by, be(bz, cc));
+ br(by, cb, bl);
+ }
+ }
+};
+void d() { bu()(b()); }
diff --git a/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-2.C b/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-2.C
new file mode 100644
index 00000000000..55621e98fee
--- /dev/null
+++ b/gcc/testsuite/g++.target/riscv/rvv/base/pr114714-2.C
@@ -0,0 +1,85 @@
+/* Test that we do not have ice when compile */
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -std=c++17" } */
+
+typedef int a;
+typedef short b;
+typedef unsigned c;
+template < typename > using e = unsigned;
+template < typename > void ab();
+#pragma riscv intrinsic "vector"
+template < typename f, int, int ac > struct g {
+ using i = f;
+ template < typename m > using j = g< m, 0, ac >;
+ using k = g< i, 1, ac - 1 >;
+ using ad = g< i, 1, ac + 1 >;
+};
+namespace ae {
+struct af {
+ using h = g< short, 6, 0 < 3 >;
+};
+struct ag {
+ using h = af::h;
+};
+} template < typename, int > using ah = ae::ag::h;
+template < class ai > using aj = typename ai::i;
+template < class i, class ai > using j = typename ai::j< i >;
+template < class ai > using ak = j< e< ai >, ai >;
+template < class ai > using k = typename ai::k;
+template < class ai > using ad = typename ai::ad;
+template < a ap > vuint16mf2_t ar(g< b, ap, 0 >, b);
+template < a ap > vuint16m1_t ar(g< b, ap, 1 >, b);
+template < a ap > vuint32m1_t ar(g< c, ap, 1 >, c);
+template < a ap > vuint32m2_t ar(g< c, ap, 2 >, c);
+template < class ai > using as = decltype(ar(ai(), aj< ai >()));
+template < class ai > as< ai > at(ai);
+namespace ae {
+template < int ap > vuint32m2_t au(g< c, ap, 1 + 1 >, vuint32m1_t l) {
+ return __riscv_vlmul_ext_v_u32m1_u32m2(l);
+}
+} template < int ap > vuint32m1_t aw(g< c, ap, 1 >, vuint16mf2_t l) {
+ return __riscv_vzext_vf2_u32m1(l, 0);
+}
+namespace ae {
+vuint32m2_t ax(vuint32m2_t, vuint32m2_t, a);
+}
+template < class ay, class an > as< ay > az(ay ba, an bc) {
+ an bb;
+ return ae::ax(ae::au(ba, bc), ae::au(ba, bb), 2);
+}
+template < class bd > as< bd > be(bd, as< ad< bd > >);
+namespace ae {
+template < class bh, class bi > void bj(bh bk, bi bl) {
+ ad< decltype(bk) > bn;
+ az(bn, bl);
+}
+} template < int ap, int ac, class bp, class bq >
+void br(g< c, ap, ac > bk, bp, bq bl) {
+ ae::bj(bk, bl);
+}
+template < class ai > using bs = decltype(at(ai()));
+struct bt;
+template < int ac = 1 > class bu {
+public:
+ template < typename i > void operator()(i) {
+ ah< i, ac > d;
+ bt()(i(), d);
+ }
+};
+struct bt {
+ template < typename bv, class bf > void operator()(bv, bf bw) {
+ using bx = bv;
+ ak< bf > by;
+ k< bf > bz;
+ using bq = bs< decltype(by) >;
+ using bp = bs< decltype(bw) >;
+ bp cb;
+ ab< bx >();
+ for (;;) {
+ bp cc;
+ bq bl = aw(by, be(bz, cc));
+ br(by, cb, bl);
+ }
+ }
+};
+void d() { bu()(b()); }
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-25 10:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-25 9:25 [PATCH v1] RISC-V: Add test cases for insn does not satisfy its constraints [PR114714] pan2.li
2024-04-25 9:27 ` juzhe.zhong
2024-04-25 10:30 ` Li, Pan2
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).