public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6883] c++: vector compound literal [PR104206]
@ 2022-01-26 19:27 Jason Merrill
  0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2022-01-26 19:27 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:9bf217920457f2e2d46b601f24721780a20a031b

commit r12-6883-g9bf217920457f2e2d46b601f24721780a20a031b
Author: Jason Merrill <jason@redhat.com>
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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-26 19:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 19:27 [gcc r12-6883] c++: vector compound literal [PR104206] Jason Merrill

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