From: Jakub Jelinek Date: Tue, 25 Jun 2019 14:05:13 +0000 (+0200) Subject: re PR c++/90969 (ICE: tree check: expected array_type, have vector_type in array_ref_... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bc2687dd948d74b181f71bf4886f4b8719c51f57;p=gcc.git re PR c++/90969 (ICE: tree check: expected array_type, have vector_type in array_ref_low_bound, at tree.c:13570) PR c++/90969 * constexpr.c (cxx_eval_array_reference): Don't look through VCE from vector type if lval. * g++.dg/ext/vector38.C: New test. From-SVN: r272654 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3459ad7718b..a0f61668559 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2019-06-25 Jakub Jelinek + + PR c++/90969 + * constexpr.c (cxx_eval_array_reference): Don't look through VCE from + vector type if lval. + 2019-06-24 Jan Hubicka * lex.c (cxx_make_type): Set TYPE_CXX_ODR_P. diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 22f4fa0d351..a3a36d09d5e 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -2616,7 +2616,8 @@ cxx_eval_array_reference (const constexpr_ctx *ctx, tree t, non_constant_p, overflow_p); if (*non_constant_p) return t; - if (TREE_CODE (ary) == VIEW_CONVERT_EXPR + if (!lval + && TREE_CODE (ary) == VIEW_CONVERT_EXPR && VECTOR_TYPE_P (TREE_TYPE (TREE_OPERAND (ary, 0))) && TREE_TYPE (t) == TREE_TYPE (TREE_TYPE (TREE_OPERAND (ary, 0)))) ary = TREE_OPERAND (ary, 0); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ca27bc3bffd..1270f44fac3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-06-25 Jakub Jelinek + + PR c++/90969 + * g++.dg/ext/vector38.C: New test. + 2019-06-25 Martin Jambor PR ipa/90939 diff --git a/gcc/testsuite/g++.dg/ext/vector38.C b/gcc/testsuite/g++.dg/ext/vector38.C new file mode 100644 index 00000000000..51a08875647 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/vector38.C @@ -0,0 +1,5 @@ +// PR c++/90969 +// { dg-do compile } + +__attribute__ ((__vector_size__ (4))) int v; +int &a = v[0];