aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-11-15 12:57:47 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-11-15 12:57:47 +0000
commitb6d53324092ee2b15c4a34fb55f2556863223d86 (patch)
tree0c5bd50c190b22c58a84d5f00ed938942db8beb8 /gcc/config
parent9ecf84e6a5616e30a03b4813b696607b2aa12d47 (diff)
downloadgcc-b6d53324092ee2b15c4a34fb55f2556863223d86.zip
gcc-b6d53324092ee2b15c4a34fb55f2556863223d86.tar.gz
gcc-b6d53324092ee2b15c4a34fb55f2556863223d86.tar.bz2
[rs6000] Use VIEW_CONVERT_EXPR to reinterpret vectors (PR 92515)
The new tree-cfg.c checking in r278245 tripped on folds of ALTIVEC_BUILTIN_VPERM_*, which were using gimple_convert rather than VIEW_CONVERT_EXPR to reinterpret the contents of a vector as a different type. 2019-11-15 Richard Sandiford <richard.sandiford@arm.com> gcc/ PR target/92515 * config/rs6000/rs6000-call.c (rs6000_gimple_fold_builtin): Use VIEW_CONVERT_EXPR to reinterpret vectors as different types. From-SVN: r278292
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/rs6000/rs6000-call.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 00ba745..85ff852 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -6173,13 +6173,16 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi)
// convert arg0 and arg1 to match the type of the permute
// for the VEC_PERM_EXPR operation.
tree permute_type = (TREE_TYPE (permute));
- tree arg0_ptype = gimple_convert (&stmts, loc, permute_type, arg0);
- tree arg1_ptype = gimple_convert (&stmts, loc, permute_type, arg1);
+ tree arg0_ptype = gimple_build (&stmts, loc, VIEW_CONVERT_EXPR,
+ permute_type, arg0);
+ tree arg1_ptype = gimple_build (&stmts, loc, VIEW_CONVERT_EXPR,
+ permute_type, arg1);
tree lhs_ptype = gimple_build (&stmts, loc, VEC_PERM_EXPR,
permute_type, arg0_ptype, arg1_ptype,
permute);
// Convert the result back to the desired lhs type upon completion.
- tree temp = gimple_convert (&stmts, loc, TREE_TYPE (lhs), lhs_ptype);
+ tree temp = gimple_build (&stmts, loc, VIEW_CONVERT_EXPR,
+ TREE_TYPE (lhs), lhs_ptype);
gsi_insert_seq_before (gsi, stmts, GSI_SAME_STMT);
g = gimple_build_assign (lhs, temp);
gimple_set_location (g, loc);