public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] c++/103326 - fix ICE in tsubst with VECTOR_CST
@ 2021-11-19  7:57 Richard Biener
  2021-11-19  8:57 ` Jakub Jelinek
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Biener @ 2021-11-19  7:57 UTC (permalink / raw)
  To: gcc-patches; +Cc: jakub

This adds missing handling of VECTOR_CST.

Bootstrap and regtest pending on x86_64-unknown-linux-gnu, OK?

Thanks,
Richard.

2021-11-19  Richard Biener  <rguenther@suse.de>

	PR c++/103326
	* pt.c (tsubst_copy): Handle VECTOR_CST.

	* g++.dg/pr103326.C: New testcase.
---
 gcc/cp/pt.c                     |  1 +
 gcc/testsuite/g++.dg/pr103326.C | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/pr103326.C

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index b27eea33272..291003719f4 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -17249,6 +17249,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
     case INTEGER_CST:
     case REAL_CST:
     case COMPLEX_CST:
+    case VECTOR_CST:
       {
 	/* Instantiate any typedefs in the type.  */
 	tree type = tsubst (TREE_TYPE (t), args, complain, in_decl);
diff --git a/gcc/testsuite/g++.dg/pr103326.C b/gcc/testsuite/g++.dg/pr103326.C
new file mode 100644
index 00000000000..260e7da86e8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr103326.C
@@ -0,0 +1,15 @@
+// { dg-do compile }
+// { dg-require-effective-target c++11 }
+
+using x86_64_v16qi [[gnu::__vector_size__ (16)]] = char;
+
+template<typename T>
+void foo()
+{
+  constexpr x86_64_v16qi zero{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+}
+
+void foo2()
+{
+  foo<int>();
+}
-- 
2.31.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] c++/103326 - fix ICE in tsubst with VECTOR_CST
  2021-11-19  7:57 [PATCH] c++/103326 - fix ICE in tsubst with VECTOR_CST Richard Biener
@ 2021-11-19  8:57 ` Jakub Jelinek
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2021-11-19  8:57 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

On Fri, Nov 19, 2021 at 08:57:01AM +0100, Richard Biener wrote:
> This adds missing handling of VECTOR_CST.
> 
> Bootstrap and regtest pending on x86_64-unknown-linux-gnu, OK?
> 
> Thanks,
> Richard.
> 
> 2021-11-19  Richard Biener  <rguenther@suse.de>
> 
> 	PR c++/103326
> 	* pt.c (tsubst_copy): Handle VECTOR_CST.
> 
> 	* g++.dg/pr103326.C: New testcase.

Ok, thanks.

	Jakub


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-19  8:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-19  7:57 [PATCH] c++/103326 - fix ICE in tsubst with VECTOR_CST Richard Biener
2021-11-19  8:57 ` Jakub Jelinek

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).