[C++] Opt out of GNU vector extensions for built-in SVE types
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 4 Dec 2019 09:18:13 +0000 (09:18 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 4 Dec 2019 09:18:13 +0000 (09:18 +0000)
commit6f1e966874de23d7e47cbaebfb5a9de6759cb089
treebeca6737116bc2ac5c28e4a0d8e95cbb7b85e652
parenta8a5f4cc04c802d74176f6935509b8a4303de399
[C++] Opt out of GNU vector extensions for built-in SVE types

This is the C++ equivalent of r277950.  The changes are very similar
to there.  Perhaps the only noteworthy thing (that I know of) is that
the patch continues to treat !gnu_vector_type_p vector types as literal
types/potential constexprs.  Disabling the GNU vector extensions
shouldn't in itself stop the types from being literal types, since
whatever the target provides instead might be constexpr material.

2019-12-04  Richard Sandiford  <richard.sandiford@arm.com>

gcc/cp/
* cp-tree.h (CP_AGGREGATE_TYPE_P): Check for gnu_vector_type_p
instead of VECTOR_TYPE.
* call.c (build_conditional_expr_1): Restrict vector handling
to vectors that satisfy gnu_vector_type_p.
* cvt.c (ocp_convert): Only allow vectors to be converted
to bool if they satisfy gnu_vector_type_p.
(build_expr_type_conversion): Only allow conversions from
vectors if they satisfy gnu_vector_type_p.
* typeck.c (cp_build_binary_op): Only allow binary operators to be
applied to vectors if they satisfy gnu_vector_type_p.
(cp_build_unary_op): Likewise unary operators.
(build_reinterpret_cast_1):

gcc/testsuite/
* g++.target/aarch64/sve/acle/general-c++/gnu_vectors_1.C: New test.
* g++.target/aarch64/sve/acle/general-c++/gnu_vectors_2.C: New test.

From-SVN: r278957
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/cvt.c
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_1.C [new file with mode: 0644]
gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_2.C [new file with mode: 0644]