aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-08-10 13:35:34 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-08-10 13:35:34 +0000
commit09e4850d7e5ab207bf04c389c80ff9bc548f8298 (patch)
tree31eaec0e13000baa8f1cb7ab7d41cd89f9b560a4 /gcc/fold-const.c
parent99cababb4b154f763a609127b498a9f0fa99b3f8 (diff)
downloadgcc-09e4850d7e5ab207bf04c389c80ff9bc548f8298.zip
gcc-09e4850d7e5ab207bf04c389c80ff9bc548f8298.tar.gz
gcc-09e4850d7e5ab207bf04c389c80ff9bc548f8298.tar.bz2
re PR middle-end/54219 (__builtin_shuffle mask reversed)
2012-08-10 Richard Guenther <rguenther@suse.de> PR middle-end/54219 * fold-const.c (fold_ternary_loc): Do not reverse the mask when canonicalizing it when folding VEC_PERM_EXPR. * gcc.dg/torture/vector-shuffle1.c: New testcase. From-SVN: r190297
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 74fbb2a..5e14125 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -14189,7 +14189,7 @@ fold_ternary_loc (location_t loc, enum tree_code code, tree type,
tree *tsel = XALLOCAVEC (tree, nelts);
tree eltype = TREE_TYPE (TREE_TYPE (arg2));
for (i = 0; i < nelts; i++)
- tsel[i] = build_int_cst (eltype, sel[nelts - i - 1]);
+ tsel[i] = build_int_cst (eltype, sel[i]);
t = build_vector (TREE_TYPE (arg2), tsel);
return build3_loc (loc, VEC_PERM_EXPR, type, op0, op1, t);
}