MODE_OPAQUE and the associated OPAQUE_TYPE were added to stop the optimizers
from knowing how the bits in a variable with an opaque type are laid out.
This makes them a kind of pseudo aggregate type and we need to treat them
as such when we process the INIT initializer for variables with an
opaque type.
2020-12-02 Peter Bergner <bergner@linux.ibm.com>
gcc/cp/
PR c++/97947
* typeck2.c (digest_init_r): Handle OPAQUE_TYPE as an aggregate type.
gcc/testsuite/
PR c++/97947
* g++.target/powerpc/pr97947.C: New test.
|| VECTOR_TYPE_P (type)
|| code == RECORD_TYPE
|| code == UNION_TYPE
+ || code == OPAQUE_TYPE
|| code == COMPLEX_TYPE);
/* "If T is a class type and the initializer list has a single
--- /dev/null
+/* PR c++/97947 */
+/* { dg-do compile } */
+/* { dg-require-effective-target power10_ok } */
+/* { dg-options "-O2 -mdejagnu-cpu=power10" } */
+
+/* Verify we do not ICE on the test below. */
+
+void
+bug (__vector_pair *src)
+{
+ volatile __vector_pair dd = *src;
+}