From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2122) id 27286389EC5B; Wed, 26 Jan 2022 19:27:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 27286389EC5B MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jason Merrill To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-6883] c++: vector compound literal [PR104206] X-Act-Checkin: gcc X-Git-Author: Jason Merrill X-Git-Refname: refs/heads/master X-Git-Oldrev: 866d73019bd4d1804f7e09409322e6605b81780b X-Git-Newrev: 9bf217920457f2e2d46b601f24721780a20a031b Message-Id: <20220126192744.27286389EC5B@sourceware.org> Date: Wed, 26 Jan 2022 19:27:44 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2022 19:27:44 -0000 https://gcc.gnu.org/g:9bf217920457f2e2d46b601f24721780a20a031b commit r12-6883-g9bf217920457f2e2d46b601f24721780a20a031b Author: Jason Merrill Date: Wed Jan 26 12:44:31 2022 -0500 c++: vector compound literal [PR104206] My patch for PR101072 removed the specific VECTOR_TYPE handling here, which broke pr72747-2.c on PPC; this patch restores it. PR c++/104206 PR c++/101072 gcc/cp/ChangeLog: * semantics.cc (finish_compound_literal): Restore VECTOR_TYPE check. Diff: --- gcc/cp/semantics.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc index 07c2b3393be..466d6b56871 100644 --- a/gcc/cp/semantics.cc +++ b/gcc/cp/semantics.cc @@ -3272,8 +3272,9 @@ finish_compound_literal (tree type, tree compound_literal, /* Represent other compound literals with TARGET_EXPR so we produce a prvalue, and can elide copies. */ - if (TREE_CODE (compound_literal) == CONSTRUCTOR - || TREE_CODE (compound_literal) == VEC_INIT_EXPR) + if (!VECTOR_TYPE_P (type) + && (TREE_CODE (compound_literal) == CONSTRUCTOR + || TREE_CODE (compound_literal) == VEC_INIT_EXPR)) { /* The CONSTRUCTOR is now an initializer, not a compound literal. */ if (TREE_CODE (compound_literal) == CONSTRUCTOR)