diff options
author | Jason Merrill <jason@redhat.com> | 2013-06-03 14:19:30 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2013-06-03 14:19:30 -0400 |
commit | ec3af349a677721e2de9583c8e14a994a5aa77a9 (patch) | |
tree | 4eeeac71d002ddd5ef4612f228d9a5523f5b4d21 /gcc/config/rs6000 | |
parent | 1baf9159af13f8e4f404427831b383b54dcd8f40 (diff) | |
download | gcc-ec3af349a677721e2de9583c8e14a994a5aa77a9.zip gcc-ec3af349a677721e2de9583c8e14a994a5aa77a9.tar.gz gcc-ec3af349a677721e2de9583c8e14a994a5aa77a9.tar.bz2 |
re PR c++/57415 (New PPC testsuite failure C++ compound literarl expr unimplemented)
PR c++/57415
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
Use TARGET_EXPR for C++.
From-SVN: r199616
Diffstat (limited to 'gcc/config/rs6000')
-rw-r--r-- | gcc/config/rs6000/rs6000-c.c | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index 801b5bb..50ff8d3 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -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); |