re PR c++/57415 (New PPC testsuite failure C++ compound literarl expr unimplemented)
authorJason Merrill <jason@redhat.com>
Mon, 3 Jun 2013 18:19:30 +0000 (14:19 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 3 Jun 2013 18:19:30 +0000 (14:19 -0400)
PR c++/57415
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
Use TARGET_EXPR for C++.

From-SVN: r199616

gcc/ChangeLog
gcc/config/rs6000/rs6000-c.c

index a638f796c309f150f9c16b28a0ca3c29142cc502..0bacab1a27a462a09bb30af47eb2014f097ff392 100644 (file)
@@ -1,3 +1,9 @@
+2013-06-03  Jason Merrill  <jason@redhat.com>
+
+       PR c++/57415
+       * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
+       Use TARGET_EXPR for C++.
+
 2013-06-03  Jakub Jelinek  <jakub@redhat.com>
 
        PR rtl-optimization/57268
index 801b5bb225d484c5a0958d039a67394bea147dc1..50ff8d39eeebd71a792462486847a21513cc70cf 100644 (file)
@@ -3822,11 +3822,20 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
       TREE_USED (decl) = 1;
       TREE_TYPE (decl) = arg1_type;
       TREE_READONLY (decl) = TYPE_READONLY (arg1_type);
-      DECL_INITIAL (decl) = arg1;
-      stmt = build1 (DECL_EXPR, arg1_type, decl);
-      TREE_ADDRESSABLE (decl) = 1;
-      SET_EXPR_LOCATION (stmt, loc);
-      stmt = build1 (COMPOUND_LITERAL_EXPR, arg1_type, stmt);
+      if (c_dialect_cxx ())
+       {
+         stmt = build4 (TARGET_EXPR, arg1_type, decl, arg1,
+                        NULL_TREE, NULL_TREE);
+         SET_EXPR_LOCATION (stmt, loc);
+       }
+      else
+       {
+         DECL_INITIAL (decl) = arg1;
+         stmt = build1 (DECL_EXPR, arg1_type, decl);
+         TREE_ADDRESSABLE (decl) = 1;
+         SET_EXPR_LOCATION (stmt, loc);
+         stmt = build1 (COMPOUND_LITERAL_EXPR, arg1_type, stmt);
+       }
 
       innerptrtype = build_pointer_type (arg1_inner_type);
 
@@ -3901,11 +3910,20 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
       TREE_USED (decl) = 1;
       TREE_TYPE (decl) = arg1_type;
       TREE_READONLY (decl) = TYPE_READONLY (arg1_type);
-      DECL_INITIAL (decl) = arg1;
-      stmt = build1 (DECL_EXPR, arg1_type, decl);
-      TREE_ADDRESSABLE (decl) = 1;
-      SET_EXPR_LOCATION (stmt, loc);
-      stmt = build1 (COMPOUND_LITERAL_EXPR, arg1_type, stmt);
+      if (c_dialect_cxx ())
+       {
+         stmt = build4 (TARGET_EXPR, arg1_type, decl, arg1,
+                        NULL_TREE, NULL_TREE);
+         SET_EXPR_LOCATION (stmt, loc);
+       }
+      else
+       {
+         DECL_INITIAL (decl) = arg1;
+         stmt = build1 (DECL_EXPR, arg1_type, decl);
+         TREE_ADDRESSABLE (decl) = 1;
+         SET_EXPR_LOCATION (stmt, loc);
+         stmt = build1 (COMPOUND_LITERAL_EXPR, arg1_type, stmt);
+       }
 
       innerptrtype = build_pointer_type (arg1_inner_type);